|
@@ -28,9 +28,7 @@
|
|
|
</view>
|
|
|
<view class="list_2">
|
|
|
<view class="l">
|
|
|
- <image class="image"
|
|
|
- :src="orderInfo.file&&orderInfo.file.length>0?orderInfo.file[0].url:''"
|
|
|
- mode=""></image>
|
|
|
+ <image class="image" :src="orderInfo.file&&orderInfo.file.length>0?orderInfo.file[0].url:''" mode=""></image>
|
|
|
</view>
|
|
|
<view class="c">
|
|
|
<view class="name">
|
|
@@ -97,8 +95,7 @@
|
|
|
<view class="two_1">
|
|
|
<checkbox-group @change="toCheckbox">
|
|
|
<label>
|
|
|
- <checkbox :value="item._id" :checked="item.checked"
|
|
|
- style="transform:scale(0.7)" />
|
|
|
+ <checkbox :value="item._id" :checked="item.checked" style="transform:scale(0.7)" />
|
|
|
选择地址
|
|
|
</label>
|
|
|
</checkbox-group>
|
|
@@ -142,6 +139,44 @@
|
|
|
that.watchLogin()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 监听用户是否登录
|
|
|
+ watchLogin() {
|
|
|
+ const that = this;
|
|
|
+ uni.getStorage({
|
|
|
+ key: 'token',
|
|
|
+ success: function(res) {
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
+ that.$set(that, `user`, user);
|
|
|
+ that.search()
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: `/pages/login/index`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询列表
|
|
|
+ async search() {
|
|
|
+ const that = this;
|
|
|
+ let user = that.user;
|
|
|
+ const res = await that.$api(`/address`, 'GET', {
|
|
|
+ customer: user._id
|
|
|
+ })
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `addressList`, res.data.reverse());
|
|
|
+ }
|
|
|
+ const arr = await that.$api(`/zrOrder/toMakeOrder`, 'POST', {
|
|
|
+ key: that.key
|
|
|
+ }, `integral`)
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ that.$set(that, `address`, arr.data.address);
|
|
|
+ that.$set(that, `orderInfo`, arr.data.goods);
|
|
|
+ that.$set(that, `costTotal`, arr.data.costTotal);
|
|
|
+ that.$set(that, `shopInfo`, arr.data.shop);
|
|
|
+ that.$set(that, `buy_num`, arr.data.buy_num);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 选择收货地址
|
|
|
toChoose() {
|
|
|
const that = this;
|
|
@@ -236,44 +271,6 @@
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
- },
|
|
|
- // 监听用户是否登录
|
|
|
- watchLogin() {
|
|
|
- const that = this;
|
|
|
- uni.getStorage({
|
|
|
- key: 'token',
|
|
|
- success: function(res) {
|
|
|
- let user = that.$jwt(res.data);
|
|
|
- that.$set(that, `user`, user);
|
|
|
- that.search()
|
|
|
- },
|
|
|
- fail: function(err) {
|
|
|
- uni.reLaunch({
|
|
|
- url: `/pages/login/index`
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询列表
|
|
|
- async search() {
|
|
|
- const that = this;
|
|
|
- let user = that.user;
|
|
|
- const res = await that.$api(`/address`, 'GET', {
|
|
|
- customer: user._id
|
|
|
- })
|
|
|
- if (res.errcode == '0') {
|
|
|
- that.$set(that, `addressList`, res.data.reverse());
|
|
|
- }
|
|
|
- const arr = await that.$api(`/zrOrder/toMakeOrder`, 'POST', {
|
|
|
- key: that.key
|
|
|
- }, `integral`)
|
|
|
- if (arr.errcode == '0') {
|
|
|
- that.$set(that, `address`, arr.data.address);
|
|
|
- that.$set(that, `orderInfo`, arr.data.goods);
|
|
|
- that.$set(that, `costTotal`, arr.data.costTotal);
|
|
|
- that.$set(that, `shopInfo`, arr.data.shop);
|
|
|
- that.$set(that, `buy_num`, arr.data.buy_num);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -369,7 +366,8 @@
|
|
|
.r {
|
|
|
width: 15vw;
|
|
|
text-align: right;
|
|
|
- .price{
|
|
|
+
|
|
|
+ .price {
|
|
|
color: var(--ff0Color);
|
|
|
}
|
|
|
}
|