Browse Source

上传

master
前端-胡立永 5 months ago
parent
commit
2780c4e5c6
15 changed files with 171 additions and 48 deletions
  1. +3
    -0
      App.vue
  2. +40
    -0
      common.scss
  3. +34
    -15
      pages/index/cart.vue
  4. +11
    -0
      pages/index/category.vue
  5. +5
    -5
      pages/index/center.vue
  6. +6
    -4
      pages/index/index.vue
  7. +7
    -0
      pages/index/order.vue
  8. +1
    -1
      pages_order/components/commodity/commoditySelect.vue
  9. +9
    -6
      pages_order/components/product/submit.vue
  10. +2
    -1
      pages_order/components/product/submitUnitSelect.vue
  11. +14
    -1
      pages_order/mine/address.vue
  12. +12
    -11
      pages_order/order/applyLaundryStore.vue
  13. +2
    -2
      pages_order/order/orderDetail.vue
  14. +19
    -2
      pages_order/product/productDetail.vue
  15. +6
    -0
      store/store.js

+ 3
- 0
App.vue View File

@ -5,6 +5,9 @@
onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('getPosition')
if(uni.getStorageSync('token')){
this.$store.commit('getUserInfo')
}
},
onHide: function() {
}


+ 40
- 0
common.scss View File

@ -0,0 +1,40 @@
// 文字益处处理
.text-ellipsis{
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行
}
.text-ellipsis-2{
overflow: hidden;
text-overflow: ellipsis;
display:-webkit-box; //作为弹性伸缩盒子模型显示
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:2; //显示的行
}
.text-ellipsis-3{
overflow: hidden;
text-overflow: ellipsis;
display:-webkit-box; //作为弹性伸缩盒子模型显示
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:3; //显示的行
}
.share{
padding: 0;
margin: 0;
background-color: #fff;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
align-items: center !important;
font-size: 26rpx;
}
.share::after{
border: none;
padding: 0;
margin: 0;
width: 0;
height: 0;
}

+ 34
- 15
pages/index/cart.vue View File

@ -3,14 +3,15 @@
<navbar />
<view class="user">
<uv-checkbox-group shape="circle" v-model="checkboxValue">
<uv-checkbox-group shape="circle" v-model="checkboxValue"
v-if="list.records.length > 0">
<uv-swipe-action>
<view v-for="(item, index) in list.records" :key="index">
<view style="margin-top: 20rpx;"></view>
<uv-swipe-action-item :options="options" @click="delCart(item, index)">
<view class="item">
<view class="checkbox">
<uv-checkbox :name="item.goodsId" activeColor="#FA5A0A" size="40rpx"
<uv-checkbox :name="item.id" activeColor="#FA5A0A" size="40rpx"
icon-size="35rpx"></uv-checkbox>
</view>
@ -32,7 +33,7 @@
</view>
<view class="price">
<text>{{ item.price }}</text>
<text>{{ item.depositPrice }}</text>
</view>
</view>
@ -41,6 +42,13 @@
</view>
</uv-swipe-action>
</uv-checkbox-group>
<uv-empty
v-else
text="空空如也"
textSize="30rpx"
iconSize="200rpx"
icon="list"></uv-empty>
<view class="action">
<view class="icon">
@ -102,7 +110,9 @@
pageNo: 1,
pageSize: 10,
},
list: [],
list: {
records : [],
},
addressTotal: 0,
address: {
name: '请选择联系人',
@ -135,7 +145,7 @@
let price = 0
this.list.records.forEach(n => {
if (this.checkboxValue.includes(n.id)) {
price += n.price * n.num
price += n.depositPrice * n.num
}
})
return price
@ -192,6 +202,13 @@
})
return
}
if (this.addressTotal == 0) {
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
//
this.$refs.addressPopup.open('bottom')
},
@ -211,7 +228,7 @@
let data = []
let records = this.list.records
for (var i = 0; i < records.length; i++) {
if (this.checkboxValue.includes(records[i].goodsId)) {
if (this.checkboxValue.includes(records[i].id)) {
data.push({
id: records[i].goodsId, //id
skuId: records[i].skuId, //id
@ -229,6 +246,17 @@
let form = {
id: res.result.id
}
//
self.$api('cartDel', {
id: deleteCartIds
}, res => {
if (res.code == 200) {
self.getData()
}
})
this.$api('orderPay', form, res => {
if (res.code == 200) {
uni.requestPayment({
@ -241,15 +269,6 @@
success: function(res) {
console.log('支付成功', res);
//
self.$api('cartDel', {
id: deleteCartIds
}, res => {
if (res.code == 200) {
self.getData()
}
})
uni.redirectTo({
url: '/pages/index/order'
})


+ 11
- 0
pages/index/category.vue View File

@ -102,6 +102,17 @@
</script>
<style scoped lang="scss">
.page{
/deep/ .uv-vtabs{
height: calc(100vh - 360rpx) !important;
}
/deep/ .uv-vtabs__bar{
height: calc(100vh - 360rpx) !important;
}
/deep/ .uv-vtabs__content{
height: calc(100vh - 360rpx) !important;
}
}
.category {
font-size: 30rpx;
color: #333;


+ 5
- 5
pages/index/center.vue View File

@ -27,9 +27,9 @@
今天是您来的的第32天
</view> -->
</view>
<view class="headBtn" @click="headBtn">
<!-- <view class="headBtn" @click="headBtn">
角色切换
</view>
</view> -->
<view class="setting">
<uv-icon name="setting" size="40rpx"></uv-icon>
</view>
@ -292,9 +292,9 @@
}
.setting {
// position: absolute;
// right: 50rpx;
// top: 50rpx;
position: absolute;
right: 50rpx;
top: 50rpx;
margin-left: 20rpx;
}
}


+ 6
- 4
pages/index/index.vue View File

@ -65,10 +65,10 @@
fontSize="28rpx"
:text="notice"></uv-notice-bar>
<view class="shop">
<view class="shop" v-if="bindShop && bindShop.name">
<image
class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
:src="bindShop.pic"
mode=""></image>
<view class="shopInfo">
<view class="title">
@ -86,7 +86,7 @@
9:00-18:00
<!-- {{bindShop.address}} -->
</view>
<view class="address">
<view class="address text-ellipsis-2">
<!-- 长沙市天心区桂花坪街道231号 -->
{{bindShop.address}}
</view>
@ -162,7 +162,7 @@
title : '破损换货',
},
],
bindShop:{},
bindShop : {},
}
},
onShow() {
@ -453,6 +453,7 @@
height: 180rpx;
margin-right: 20rpx;
border-radius: 20rpx;
flex-shrink: 0;
}
.shopInfo{
font-size: 22rpx;
@ -484,6 +485,7 @@
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.btn{
background-color: $uni-color;
color: #fff;


+ 7
- 0
pages/index/order.vue View File

@ -100,6 +100,13 @@
</view>
</view>
<uv-empty
v-else
text="空空如也"
textSize="30rpx"
iconSize="200rpx"
icon="list"></uv-empty>
<tabber select="2" v-if="!uid"/>
</view>
</template>


+ 1
- 1
pages_order/components/commodity/commoditySelect.vue View File

@ -9,7 +9,7 @@
<view class="center">
<view>{{ item.goodsName }}</view>
<view>规格:{{ item.sku }}</view>
<view>下单时间:{{item.startTime}}</view>
<view>下单时间:{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}</view>
</view>
<view class="right">×{{item.num}}</view>
</view>


+ 9
- 6
pages_order/components/product/submit.vue View File

@ -14,12 +14,15 @@
</view>
<view class=""
@click="$utils.navigateTo('/index/cart')">
<uv-icon
size="40rpx"
name="shopping-cart"></uv-icon>
<view class="">
购物车
</view>
<button
class="share">
<uv-icon
size="40rpx"
name="shopping-cart"></uv-icon>
<view class="">
购物车
</view>
</button>
</view>
<view class="btn"
@click="$emit('submit')">


+ 2
- 1
pages_order/components/product/submitUnitSelect.vue View File

@ -131,8 +131,9 @@
//
openAddress() {
if (this.addressTotal == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address'
url: '/pages_order/mine/address?type=back'
})
}
this.$refs.addressPopup.open('bottom')


+ 14
- 1
pages_order/mine/address.vue View File

@ -39,7 +39,15 @@
},
data() {
return {
title: '新增地址'
title: '新增地址',
type : '',
}
},
onLoad(args) {
this.type = args.type
if(this.type == 'back'){
this.addBtn()
}
},
onShow() {
@ -83,6 +91,11 @@
if (res.code == 200) {
this.$refs.addressPopup.close()
this.getAddressList()
if(this.type == 'back'){
uni.navigateBack(-1)
}
uni.showToast({
title: '操作成功',
icon: 'none'


+ 12
- 11
pages_order/order/applyLaundryStore.vue View File

@ -30,11 +30,13 @@
<view class="currentRegion">
<view>所在地区</view>
<view>
<input class="input" v-model="form.currentRegion" placeholder="请选择所在地区"></input>
<view class="orientation" @click.stop="selectAddr">
定位
<image src="../static/address/selectIcon.png"
<view @click.stop="selectAddr">
<input class="input"
disabled
v-model="form.currentRegion" placeholder="请选择所在地区"></input>
<view class="orientation">
<!-- 定位 -->
<image src="/static/image/address/selectIcon.png"
style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;"></image>
</view>
</view>
@ -108,11 +110,7 @@
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/center'
})
}, 1500)
setTimeout(uni.navigateBack, 1500, -1)
}
})
},
@ -276,7 +274,7 @@
// color: #a4a4a4;
font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx;
width: 300rpx;
width: 350rpx;
}
.orientation {
@ -284,6 +282,9 @@
padding: 10rpx 10rpx 10rpx 20rpx;
font-size: 30rpx;
color: #FBAB32;
flex-direction: column;
justify-content: center;
align-items: center;
}


+ 2
- 2
pages_order/order/orderDetail.vue View File

@ -37,7 +37,7 @@
<view class="server-item">
<view class="img-box">
<image :src="order.reasonPic" mode="aspectFill"></image>
<image :src="order.pic" mode="aspectFill"></image>
</view>
<view class="server-info">
@ -193,7 +193,7 @@
</view>
</view>
<view class="min_tips" style="line-height: 40rpx;">
{{msgShop.projectExplain}}
<!-- {{msgShop.projectExplain}} -->
</view>
<view class="btns">
<view @click="clickService" class="btn">


+ 19
- 2
pages_order/product/productDetail.vue View File

@ -60,7 +60,17 @@
<view class="title">
商品详情
</view>
<uv-parse :content="detail.detail"></uv-parse>
<!-- <uv-parse :content="detail.detail"></uv-parse> -->
<!-- <img
:src="detail.detail"
style="width: 100%;height: 800rpx;"
alt="" /> -->
<image
v-for="(item,index) in detail.detail && detail.detail.split(',')"
:src="item"
style="width: 100%;"
mode="widthFix"></image>
</view>
<!-- 分享和租赁按钮 -->
@ -90,10 +100,16 @@
}
},
onLoad(args) {
console.log(args);
this.id = args.id
this.getData()
},
//
onShareAppMessage(res) {
return {
title: this.detail.name,
path: '/pages_order/product/productDetail?id=' + this.id
}
},
methods: {
//
share(){
@ -121,6 +137,7 @@
<style scoped lang="scss">
.page{
padding-bottom: 100rpx;
.swipe{
}


+ 6
- 0
store/store.js View File

@ -64,7 +64,11 @@ const store = new Vuex.Store({
return
}
state.userInfo = res.result.userInfo
state.shop = !!state.userInfo.shop
uni.setStorageSync('token', res.result.token)
if(!state.userInfo.nickName || !state.userInfo.headImage){
@ -82,6 +86,8 @@ const store = new Vuex.Store({
api('getInfo', res => {
if(res.code == 200){
state.userInfo = res.result
state.shop = !!state.userInfo.shop
}
})
},


Loading…
Cancel
Save