暂时去掉登录时候client参数,会引发account唯一索引错误
This commit is contained in:
@ -69,7 +69,7 @@
|
||||
<view>门店</view>
|
||||
</view>
|
||||
<view class="u-m-l-64 flex1">
|
||||
<u-button hover-class="none" @click="onBuy"
|
||||
<u-button hover-class="none" @click="showSpecFun"
|
||||
:customStyle="{height: '92rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
@ -78,7 +78,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shop-spec v-model="showSpec" :name="goods.name" :spec="goods.goods_spec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
|
||||
<shop-spec v-model="showSpec" :name="goods.name" :goods="goods" @close="showSpec = false" @confirm="confirmSpec" @buynow="onBuy"></shop-spec>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -100,6 +100,7 @@
|
||||
showSpec: false,
|
||||
goods: [],
|
||||
spec: [],
|
||||
checkedGoods: {},
|
||||
}
|
||||
},
|
||||
|
||||
@ -139,20 +140,25 @@
|
||||
this.showSpec = false
|
||||
},
|
||||
|
||||
// 购买商品
|
||||
onBuy() {
|
||||
// 这里需压判断选购规格
|
||||
if (!this.isLogin) return toLogin();
|
||||
this.$store.commit("setBuyGoods", {
|
||||
id: this.id, // 商品id
|
||||
num: 1, // 购买商品数量
|
||||
spec: this.spec // 选中的商品规格
|
||||
});
|
||||
onChangeGoods(e) {
|
||||
console.log(e);
|
||||
this.checkedGoods = e.detail;
|
||||
},
|
||||
|
||||
// console.log("this.$>>>", this.$store.state.goods.buyGoods);
|
||||
|
||||
// 选择规格
|
||||
showSpecFun() {
|
||||
if (!this.isLogin) return toLogin();
|
||||
this.showSpec = true;
|
||||
},
|
||||
|
||||
// 购买商品
|
||||
onBuy(e) {
|
||||
let {id, goodsNum} = e.detail
|
||||
let goods = [{item_id: id, num: goodsNum}]
|
||||
const params = {goods}
|
||||
this.showSpec = false
|
||||
uni.navigateTo({
|
||||
url: `/pages/order_now/order_now`
|
||||
url: '/pages/order_now/order_now?data=' + encodeURIComponent((JSON.stringify(params)))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user