|
@@ -17,12 +17,7 @@
|
|
|
<view class="two">
|
|
|
<view class="two_1">
|
|
|
<view class="money_1">
|
|
|
- <text>¥</text>
|
|
|
- <text>{{specs&&specs.length>0?specs[0].sell_money:0}}</text>
|
|
|
- </view>
|
|
|
- <view class="money_2">
|
|
|
- <text>¥</text>
|
|
|
- <text>{{specs&&specs.length>0?specs[0].flow_money:0}}</text>
|
|
|
+ <text>{{info.cost||0}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="two_2">{{info.name}}</view>
|
|
@@ -62,7 +57,6 @@
|
|
|
</view>
|
|
|
<view class="five">
|
|
|
<view class="five_1">
|
|
|
- <!-- <u-parse :content="info.brief"></u-parse> -->
|
|
|
<rich-text :nodes="info.brief"></rich-text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -113,7 +107,7 @@
|
|
|
</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="thr">
|
|
|
+ <view class="thr">
|
|
|
<text>数量</text>
|
|
|
<view class="count">
|
|
|
<uni-number-box :min="1" :max="specsInfo.num" :disabled="disabled" v-model="num"
|
|
@@ -121,7 +115,7 @@
|
|
|
</uni-number-box>
|
|
|
</view>
|
|
|
<text>库存{{specsInfo.num||0}}</text>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
<view class="btn" @click="toBuy">
|
|
|
立即兑换
|
|
|
</view>
|
|
@@ -217,22 +211,23 @@
|
|
|
onShow: async function() {
|
|
|
const that = this;
|
|
|
await that.search();
|
|
|
+ await that.searchOther();
|
|
|
await that.configShare();
|
|
|
},
|
|
|
methods: {
|
|
|
- //店铺,
|
|
|
- // 购物车,客服跳转
|
|
|
- onClick(e) {
|
|
|
- const that = this;
|
|
|
- if (e.index == '0' && e.content.route) {
|
|
|
- // 进入店铺
|
|
|
- that.toShop();
|
|
|
- } else {
|
|
|
- uni.reLaunch({
|
|
|
- url: `/${e.content.route}`
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ // //店铺,
|
|
|
+ // // 购物车,客服跳转
|
|
|
+ // onClick(e) {
|
|
|
+ // const that = this;
|
|
|
+ // if (e.index == '0' && e.content.route) {
|
|
|
+ // // 进入店铺
|
|
|
+ // that.toShop();
|
|
|
+ // } else {
|
|
|
+ // uni.reLaunch({
|
|
|
+ // url: `/${e.content.route}`
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// 进入店铺
|
|
|
toShop() {
|
|
|
const that = this;
|
|
@@ -372,32 +367,29 @@
|
|
|
const that = this;
|
|
|
uni.getStorage({
|
|
|
key: 'token',
|
|
|
- success: function(res) {
|
|
|
+ success: async function(res) {
|
|
|
let user = that.$jwt(res.data);
|
|
|
if (user) that.$set(that, `user`, user);
|
|
|
- that.searchOther();
|
|
|
+ let arr = await that.$api(`/zrGoods/${that.id}`, `POST`, {}, `integral`)
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ if (arr.data.brief) arr.data.brief = arr.data.brief.replace(/\<img/gi,
|
|
|
+ '<img class="rich-img"');
|
|
|
+ that.$set(that, `info`, arr.data)
|
|
|
+ that.$set(that, `bannerList`, arr.data.file)
|
|
|
+ let shop = await that.$api(`/shop/${arr.data.shop}`, `GET`)
|
|
|
+ if (shop.errcode == '0') {
|
|
|
+ that.$set(that, `shop`, shop.data)
|
|
|
+ }
|
|
|
+ let con = await that.$api(`/goodsRate`, `GET`, {
|
|
|
+ goods: arr.data._id
|
|
|
+ })
|
|
|
+ if (con.errcode == '0') {
|
|
|
+ that.$set(that, `comment`, con.total)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
fail: function(err) {}
|
|
|
});
|
|
|
- let res = await that.$api(`/viewGoods/goodsDetail`, `POST`, {
|
|
|
- id: that.id
|
|
|
- });
|
|
|
- if (res.errcode == '0') {
|
|
|
- let data = res.data;
|
|
|
- if (data.goods.brief) data.goods.brief = data.goods.brief.replace(/\<img/gi,
|
|
|
- '<img class="rich-img"');
|
|
|
- that.$set(that, `info`, data.goods)
|
|
|
- that.$set(that, `specs`, data.specs)
|
|
|
- that.$set(that, `shop`, data.shop)
|
|
|
- if (data.specs.length > 0) that.$set(that.specsInfo, `sell_money`, data.specs[0].sell_money)
|
|
|
- that.$set(that, `bannerList`, data.goods.file)
|
|
|
- let con = await that.$api(`/goodsRate`, `GET`, {
|
|
|
- goods: data.goods._id
|
|
|
- })
|
|
|
- if (con.errcode == '0') {
|
|
|
- that.$set(that, `comment`, con.total)
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
async searchOther() {
|
|
|
const that = this;
|