Browse Source

上传

master
前端-胡立永 9 months ago
parent
commit
8f7d341dac
9 changed files with 171 additions and 25 deletions
  1. +0
    -1
      api/api.js
  2. +6
    -0
      components/tourGuide/locations.vue
  3. +2
    -2
      config.js
  4. +0
    -2
      pages_order/components/list/cardList.vue
  5. +19
    -7
      pages_order/components/product/cartAction.vue
  6. +123
    -7
      pages_order/mine/cart.vue
  7. +11
    -1
      pages_order/mine/subscribe.vue
  8. +4
    -3
      pages_order/order/order.vue
  9. +6
    -2
      pages_order/product/productList.vue

+ 0
- 1
api/api.js View File

@ -272,7 +272,6 @@ const config = {
updateShopcar: { updateShopcar: {
url: '/user/updateShopcar', url: '/user/updateShopcar',
method: 'POST', method: 'POST',
showLoading: true,
debounce : 500, debounce : 500,
auth: true, auth: true,
}, },


+ 6
- 0
components/tourGuide/locations.vue View File

@ -69,6 +69,7 @@
v-if="show && spotGuide.length > 0"> v-if="show && spotGuide.length > 0">
<view class="main" <view class="main"
v-for="(item, index) in spotGuide" v-for="(item, index) in spotGuide"
@click="toUrl(item)"
:key="index"> :key="index">
<image <image
class="main-image" class="main-image"
@ -199,6 +200,11 @@
callouttap(e) { callouttap(e) {
console.log('地图点击事件', e) console.log('地图点击事件', e)
}, },
toUrl(item){
if(item.categoryId == 0){
// this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}&type=Inheritance`)
}
},
} }
} }
</script> </script>


+ 2
- 2
config.js View File

@ -44,7 +44,7 @@ const defaultConfig = {
api : 'queryArticleById', api : 'queryArticleById',
}, },
Inheritance : {//遗产概况 Inheritance : {//遗产概况
title : '遗产概况',
title : '文化遗产',
api : 'queryArticleById', api : 'queryArticleById',
}, },
tell : {//遗产讲述 tell : {//遗产讲述
@ -54,13 +54,13 @@ const defaultConfig = {
payType : 1, payType : 1,
screen : true, screen : true,
roleId : 0, roleId : 0,
showRoleLevel : true,
}, },
travel : {//达人同游 travel : {//达人同游
title : '达人同游', title : '达人同游',
collectType : 1, collectType : 1,
subTitle : '同游现场', subTitle : '同游现场',
payType : 2, payType : 2,
showRoleLevel : true,
roleId : 1, roleId : 1,
}, },
path : {//遗产路径 path : {//遗产路径


+ 0
- 2
pages_order/components/list/cardList.vue View File

@ -83,8 +83,6 @@
roleId : this.dict.roleId, roleId : this.dict.roleId,
} }
console.log(this.result);
this.result.forEach(n => { this.result.forEach(n => {
queryParams[n.name] = n.value queryParams[n.name] = n.value
}) })


+ 19
- 7
pages_order/components/product/cartAction.vue View File

@ -3,22 +3,23 @@
<view class="icon"> <view class="icon">
<image src="/static/image/cart/1.png" mode=""></image> <image src="/static/image/cart/1.png" mode=""></image>
<view class="num"> <view class="num">
{{ cartCheckboxValue.length }}
{{ num || cartCheckboxValue.length }}
</view> </view>
</view> </view>
<view class="price"> <view class="price">
<view class="count"> <view class="count">
合计 合计
<view class=""> <view class="">
<text>{{ totalPrice }}</text>
<text>{{ price || totalPrice }}</text>
</view> </view>
</view> </view>
<view class="text"> <view class="text">
{{ cartCheckboxValue.length }}已享受更低优惠
{{ num || cartCheckboxValue.length }}已享受更低优惠
</view> </view>
</view> </view>
<view class="btn">
去结算
<view class="btn"
@click="$emit('submit')">
{{ submitTitle }}
</view> </view>
</view> </view>
</template> </template>
@ -26,6 +27,17 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
props : {
submitTitle : {
default : '结算'
},
price : {
default : 0
},
num : {
default : 0
}
},
data() { data() {
return { return {
} }
@ -37,9 +49,9 @@
} }
let price = 0 let price = 0
this.cartList.forEach(n => { this.cartList.forEach(n => {
if (this.cartCheckboxValue.includes(n.shopcar.id)) {
// if (this.cartCheckboxValue.includes(n.shopcar.id)) {
price += n.wares.waresPrice * (n.shopcar.shopcarNumber || 1) price += n.wares.waresPrice * (n.shopcar.shopcarNumber || 1)
}
// }
}) })
return price return price
}, },


+ 123
- 7
pages_order/mine/cart.vue View File

@ -3,9 +3,10 @@
<navbar title="购物车" leftClick @leftClick="$utils.navigateBack" /> <navbar title="购物车" leftClick @leftClick="$utils.navigateBack" />
<view class="user"> <view class="user">
<uv-checkbox-group
<!-- <uv-checkbox-group
shape="circle" shape="circle"
v-model="cartCheckboxValue">
v-model="cartCheckboxValue"> -->
<uv-radio-group v-model="radiovalue">
<uv-swipe-action> <uv-swipe-action>
<view <view
@ -17,12 +18,19 @@
@click="delCart(item, index)"> @click="delCart(item, index)">
<view class="item"> <view class="item">
<view class="checkbox"> <view class="checkbox">
<uv-checkbox
<!-- <uv-checkbox
:name="item.shopcar.id" :name="item.shopcar.id"
activeColor="#FA5A0A" activeColor="#FA5A0A"
size="40rpx" size="40rpx"
icon-size="35rpx" icon-size="35rpx"
></uv-checkbox>
></uv-checkbox> -->
<uv-radio
:name="item.shopcar.id"
activeColor="#FA5A0A"
size="40rpx"
icon-size="35rpx">
</uv-radio>
</view> </view>
<image <image
@ -52,10 +60,19 @@
</uv-swipe-action-item> </uv-swipe-action-item>
</view> </view>
</uv-swipe-action> </uv-swipe-action>
</uv-checkbox-group>
<!-- </uv-checkbox-group> -->
</uv-radio-group>
<cartAction/>
<cartAction
:price="totalPrice"
:num="num"
@submit="$refs.addressPopup.open('bottom')"/>
</view> </view>
<!-- 地址弹框 -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
</uv-popup>
<tabber select="3" /> <tabber select="3" />
</view> </view>
@ -64,12 +81,15 @@
<script> <script>
import cartAction from '../components/product/cartAction.vue' import cartAction from '../components/product/cartAction.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import addressList from '../components/address/addressList.vue'
export default { export default {
components: { components: {
cartAction
cartAction,
addressList,
}, },
data() { data() {
return { return {
radiovalue : 0,
options: [ options: [
{ {
text: '删除', text: '删除',
@ -78,15 +98,60 @@
} }
}, },
], ],
addressTotal: 0,
address: {
name: '请选择联系人',
addressDetail: ''
},
} }
}, },
computed: { computed: {
...mapState(['cartList', 'cartCheckboxValue']), ...mapState(['cartList', 'cartCheckboxValue']),
totalPrice() {
if (!this.radiovalue) {
return '0'
}
let price = 0
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
price += n.wares.waresPrice * (n.shopcar.shopcarNumber || 1)
}
})
return price
},
num(){
if (!this.radiovalue) {
return '0'
}
let num = 0
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
num += (n.shopcar.shopcarNumber || 1)
}
})
return num
},
}, },
onShow() { onShow() {
this.$store.commit('getCartList') this.$store.commit('getCartList')
this.getAddressListA()
}, },
methods: { methods: {
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
this.submit()
},
//
getAddressListA() {
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
},
valChange(item, e){ valChange(item, e){
this.$api('updateShopcar', { this.$api('updateShopcar', {
id : item.shopcar.id, id : item.shopcar.id,
@ -106,6 +171,57 @@
} }
}) })
}, },
submit(){
let data = {}
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
data.waresId = n.shopcar.waresId
data.number = n.shopcar.shopcarNumber
data.addressId = this.address.id
}
})
if(this.$utils.verificationAll(data, {
addressId : '请选择地址',
waresId : '请选择商品',
number : '请选择数量',
})){
return
}
this.$api('addWaresOrder', data, res => {
if(res.code == 200){
uni.redirectTo({
url: '/pages_order/order/order'
})
// uni.requestPayment({
// provider: 'wxpay', //
// timeStamp: res.result.timeStamp, //
// nonceStr: res.result.nonceStr, //
// package: res.result.packageValue,
// signType: res.result.signType, //
// paySign: res.result.paySign, //
// success: function (res) {
// console.log('',res);
// uni.redirectTo({
// url: '/pages/index/order'
// })
// },
// fail: function (err) {
// console.log('',err);
// uni.showToast({
// icon:'none',
// title:""
// })
// }
// });
}
})
},
} }
} }
</script> </script>


+ 11
- 1
pages_order/mine/subscribe.vue View File

@ -67,6 +67,10 @@
</uv-cell> </uv-cell>
<view class="btns"> <view class="btns">
<view class="btn-info">
{{ statusTitle[item.orderStatus] }}
</view>
<view class="btn" <view class="btn"
@click="toUrl(item)"> @click="toUrl(item)">
再次预约 再次预约
@ -84,6 +88,7 @@
mixins : [mixinsList], mixins : [mixinsList],
data() { data() {
return { return {
statusTitle : ['待支付', '待使用', '已完成'],
tabs: [ tabs: [
{ {
name: '路径定制' name: '路径定制'
@ -160,7 +165,12 @@
} }
.btns{ .btns{
display: flex; display: flex;
justify-content: flex-end;
justify-content: space-between;
.btn-info{
padding: 10px 30rpx;
font-size: 24rpx;
color: $uni-color;
}
.btn{ .btn{
padding: 10px 30rpx; padding: 10px 30rpx;
font-size: 24rpx; font-size: 24rpx;


+ 4
- 3
pages_order/order/order.vue View File

@ -36,7 +36,7 @@
<!-- <text>{{item.type_dictText}}</text> --> <!-- <text>{{item.type_dictText}}</text> -->
</view> </view>
<view class="status"> <view class="status">
<text> {{item.state_dictText}}</text>
<text> {{ statusTitle[item.travelWaresOrder.status] }}</text>
</view> </view>
</view> </view>
@ -98,6 +98,7 @@
}, },
data() { data() {
return { return {
statusTitle : ['待支付', '待发货', '待收货', '已完成'],
tabs: [ tabs: [
{ {
name: '全部' name: '全部'
@ -131,7 +132,7 @@
}, },
methods: { methods: {
//tab //tab
clickTabs(index) {
clickTabs({index}) {
if (index == 0) { if (index == 0) {
this.state = -1; this.state = -1;
} else { } else {
@ -150,7 +151,7 @@
...this.queryParams, ...this.queryParams,
} }
if(this.state != -1){ if(this.state != -1){
queryParams.state = this.state
queryParams.status = this.state
} }
this.$api('queryWaresOrderList', queryParams, res => { this.$api('queryWaresOrderList', queryParams, res => {
if(res.code == 200){ if(res.code == 200){


+ 6
- 2
pages_order/product/productList.vue View File

@ -13,7 +13,9 @@
<productList :list="list" /> <productList :list="list" />
</view> </view>
<cartAction />
<cartAction
submitTitle="去结算"
@submit="$utils.navigateTo('/pages_order/mine/cart')"/>
<tabber /> <tabber />
</view> </view>
</template> </template>
@ -48,7 +50,9 @@
}, },
onShow() { onShow() {
this.getData() this.getData()
this.$store.commit('getCartList')
if(uni.getStorageSync('token')){
this.$store.commit('getCartList')
}
}, },
onLoad() { onLoad() {
this.queryParams.state = 0 this.queryParams.state = 0


Loading…
Cancel
Save