|
|
@@ -1,6 +1,9 @@
|
|
|
<template>
|
|
|
<view class="nut-sku-header">
|
|
|
- <img :src="goods.imagePath" />
|
|
|
+ <!-- <img :src="goods.imagePath" /> -->
|
|
|
+ <image class="nut-sku-header-img" :src="goods.imagePath" v-if="ENV != ENV_TYPE.WEB" />
|
|
|
+ <img class="nut-sku-header-img" :src="goods.imagePath" v-else />
|
|
|
+
|
|
|
<view class="nut-sku-header-right">
|
|
|
<template v-if="getSlots('sku-header-price')">
|
|
|
<slot name="sku-header-price"></slot>
|
|
|
@@ -17,10 +20,10 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { ref, watch, onMounted } from 'vue';
|
|
|
-
|
|
|
+import { reactive, toRefs, onMounted } from 'vue';
|
|
|
import { createComponent } from '@/packages/utils/create';
|
|
|
const { componentName, create, translate } = createComponent('sku-header');
|
|
|
+import Taro from '@tarojs/taro';
|
|
|
|
|
|
export default create({
|
|
|
props: {
|
|
|
@@ -34,9 +37,15 @@ export default create({
|
|
|
setup(props: any, { emit, slots }) {
|
|
|
const getSlots = (name: string) => slots[name];
|
|
|
|
|
|
+ const state = reactive({
|
|
|
+ ENV: Taro.getEnv(),
|
|
|
+ ENV_TYPE: Taro.ENV_TYPE
|
|
|
+ });
|
|
|
+
|
|
|
return {
|
|
|
getSlots,
|
|
|
- translate
|
|
|
+ translate,
|
|
|
+ ...toRefs(state)
|
|
|
};
|
|
|
}
|
|
|
});
|