页面修改
This commit is contained in:
parent
da13b53bbd
commit
74377c7dd8
@ -1,334 +1,358 @@
|
||||
<template>
|
||||
<view class="goods_list">
|
||||
<view class="head_search flex_a_c">
|
||||
<view class="search_content flex_a_c_j_sb">
|
||||
<view class="flex_a_c">
|
||||
<view class="iconfont icon-sousuo"></view>
|
||||
<input type="text" v-model="params.keyword" placeholder="请搜索">
|
||||
</view>
|
||||
<button class="search_btn" @click="searchClick">搜索</button>
|
||||
</view>
|
||||
</view>
|
||||
<block v-for="(item,i) in goodsList" :key="i">
|
||||
<view class="list_item flex_a_c">
|
||||
<image class="goods_img" :src="item.image" mode="aspectFill"></image>
|
||||
<view class="r_box flex_a_c_j_sb">
|
||||
<view class="message">
|
||||
<view class="title">{{item.store_name}}</view>
|
||||
<view class="flex_a_c">
|
||||
<view class="">分类:{{item.storeCategory.cate_name}}</view>
|
||||
<view class="unit">单位:{{item.unit_name}}</view>
|
||||
</view>
|
||||
<view class="bar_code">条形码:{{ item.bar_code || "0" }}</view>
|
||||
</view>
|
||||
<view class="redact_box">
|
||||
<view class="order_price">订货价:{{item.price}}</view>
|
||||
<button class="redact" @click="redactShow(item)">编辑</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="goods_list">
|
||||
<view class="head_search flex_a_c">
|
||||
<view class="search_content flex_a_c_j_sb">
|
||||
<view class="flex_a_c">
|
||||
<view class="iconfont icon-sousuo"></view>
|
||||
<input type="text" v-model="params.keyword" placeholder="请搜索">
|
||||
</view>
|
||||
<button class="search_btn" @click="searchClick">搜索</button>
|
||||
</view>
|
||||
</view>
|
||||
<block v-for="(item,i) in goodsList" :key="i">
|
||||
<view class="list_item flex_a_c">
|
||||
<image class="goods_img" :src="item.image" mode="aspectFill"></image>
|
||||
<view class="r_box flex_a_c_j_sb">
|
||||
<view class="message">
|
||||
<view class="goodstitle">{{item.store_name}}</view>
|
||||
<view class="flex_a_c">
|
||||
<view class="">分类:{{item.storeCategory.cate_name}}</view>
|
||||
<view class="unit">单位:{{item.unit_name}}</view>
|
||||
</view>
|
||||
<view class="bar_code">条形码:{{ item.bar_code || "无" }}</view>
|
||||
</view>
|
||||
<view class="redact_box">
|
||||
<view class="order_price">订货价:{{item.price}}</view>
|
||||
<button class="redact" @click="redactShow(item)">编辑</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<u-popup :show="popupShow" @close="popupShow = false" mode="center" :round="10" closeOnClickOverlay>
|
||||
<view class="popup_cont" v-if="redactGoods.store_name">
|
||||
<view class="title">{{redactGoods.store_name}}</view>
|
||||
<view class="message flex_a_c_j_sb">
|
||||
<view class="">分类:{{redactGoods.storeCategory.cate_name}}</view>
|
||||
<view class="">单位:{{redactGoods.unit_name}}</view>
|
||||
<view class="">订货价:{{redactGoods.price}}</view>
|
||||
</view>
|
||||
<view class="bar_code flex_a_c_j_sb">
|
||||
<view>条形码:{{ redactGoods.bar_code || "0" }}</view>
|
||||
<view>库存:{{ redactGoods.stock }}</view>
|
||||
</view>
|
||||
<view class="sub_title">订货价</view>
|
||||
<input class="input" type="text" placeholder="请输入价格" v-model="goodsPrive">
|
||||
<view class="sub_title">库存量</view>
|
||||
<input class="input" type="number" placeholder="请输入库存数量" v-model="goodsNum">
|
||||
<view class="btns_box">
|
||||
<view class="cancel" @click="popupClose">取消</view>
|
||||
<view class="save" @click="submitCreatedGoods">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
<u-popup :show="popupShow" @close="popupShow = false" mode="center" :round="10" closeOnClickOverlay>
|
||||
<view class="popup_cont" v-if="redactGoods.store_name">
|
||||
<view class="title">{{redactGoods.store_name}}</view>
|
||||
<view class="message flex_a_c_j_sb">
|
||||
<view class="">分类:{{redactGoods.storeCategory.cate_name}}</view>
|
||||
<view class="">单位:{{redactGoods.unit_name}}</view>
|
||||
<view class="">订货价:{{redactGoods.price}}</view>
|
||||
</view>
|
||||
<view class="bar_code flex_a_c_j_sb">
|
||||
<view>条形码:{{ redactGoods.bar_code || "无" }}</view>
|
||||
<view>库存:{{ redactGoods.stock }}</view>
|
||||
</view>
|
||||
<view class="sub_title">订货价</view>
|
||||
<input class="input" type="text" placeholder="请输入价格" v-model="goodsPrive">
|
||||
<view class="sub_title">库存量</view>
|
||||
<input class="input" type="number" placeholder="请输入库存数量" v-model="goodsNum">
|
||||
<view class="btns_box">
|
||||
<view class="cancel" @click="popupClose">取消</view>
|
||||
<view class="save" @click="submitCreatedGoods">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getStorage,
|
||||
removeStorage,
|
||||
Toast,
|
||||
Loading,
|
||||
hideLoading,
|
||||
Modal
|
||||
} from '@/libs/uniApi.js';
|
||||
import { productLstApi, productCreate, productUpdate, productDetail } from '@/api/product.js'
|
||||
import { checkLogin } from '../../../libs/login';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsPrive: '',
|
||||
goodsNum: '',
|
||||
goodsList: [],
|
||||
redactGoods: {},
|
||||
search: '',
|
||||
popupShow: false,
|
||||
merId: '',
|
||||
product_id: '',
|
||||
addGoodsSecoundData: {
|
||||
is_good: 0, // 是否推荐
|
||||
is_gift_bag: 0,
|
||||
sort: '',
|
||||
once_count: '', // 限购数量
|
||||
video_link: ''
|
||||
},
|
||||
disModel: false,
|
||||
particulars: {},
|
||||
mer_id: '',
|
||||
status: 'loadmore',
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '实在没有了',
|
||||
params: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
keyword: ''
|
||||
},
|
||||
// page: 1,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.mer_id = e.merid
|
||||
this.getGoodsList()
|
||||
this.initData();
|
||||
import {
|
||||
getStorage,
|
||||
removeStorage,
|
||||
Toast,
|
||||
Loading,
|
||||
hideLoading,
|
||||
Modal
|
||||
} from '@/libs/uniApi.js';
|
||||
import {
|
||||
productLstApi,
|
||||
productCreate,
|
||||
productUpdate,
|
||||
productDetail
|
||||
} from '@/api/product.js'
|
||||
import {
|
||||
checkLogin
|
||||
} from '../../../libs/login';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsPrive: '',
|
||||
goodsNum: '',
|
||||
goodsList: [],
|
||||
redactGoods: {},
|
||||
search: '',
|
||||
popupShow: false,
|
||||
merId: '',
|
||||
product_id: '',
|
||||
addGoodsSecoundData: {
|
||||
is_good: 0, // 是否推荐
|
||||
is_gift_bag: 0,
|
||||
sort: '',
|
||||
once_count: '', // 限购数量
|
||||
video_link: ''
|
||||
},
|
||||
disModel: false,
|
||||
particulars: {},
|
||||
mer_id: '',
|
||||
status: 'loadmore',
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '实在没有了',
|
||||
params: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
keyword: ''
|
||||
},
|
||||
// page: 1,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.mer_id = e.merid
|
||||
this.getGoodsList()
|
||||
this.initData();
|
||||
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: e.title
|
||||
// })
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
async searchClick() {
|
||||
const { data } = await productLstApi(this.mer_id, this.params)
|
||||
this.goodsList = data.list
|
||||
},
|
||||
async getGoodsList() {
|
||||
const { data } = await productLstApi(this.mer_id, this.params)
|
||||
this.goodsList.push(...data.list)
|
||||
if (data.length < 9) this.status = 'nomore';
|
||||
},
|
||||
redactShow(item) {
|
||||
this.product_id = item.product_id
|
||||
this.merId = item.mer_id
|
||||
this.redactGoods = item
|
||||
this.popupShow = true
|
||||
productDetail(item.mer_id, item.product_id).then(res => {
|
||||
this.particulars = res.data
|
||||
})
|
||||
// console.log('打开弹框', item);
|
||||
},
|
||||
popupClose() {
|
||||
this.goodsPrive = ''
|
||||
this.goodsNum = ''
|
||||
this.popupShow = false
|
||||
},
|
||||
// 创建商品
|
||||
async submitCreatedGoods() {
|
||||
this.particulars.attrValue[0].stock = Number(this.goodsNum)
|
||||
this.particulars.attrValue[0].price = this.goodsPrive
|
||||
const res = await productUpdate(this.merId, this.product_id, this.particulars)
|
||||
// Toast(message)
|
||||
this.getGoodsList()
|
||||
this.popupShow = false
|
||||
this.goodsPrive = ''
|
||||
this.goodsNum = ''
|
||||
},
|
||||
initData() {
|
||||
let editGoodsDetils = {};
|
||||
if (getStorage('goodsDis')) {
|
||||
this.disModel = true;
|
||||
}
|
||||
if (this.product_id) {
|
||||
editGoodsDetils = getStorage('editGoodsDetils');
|
||||
Object.keys(this.addGoodsSecoundData).forEach(item => {
|
||||
this.addGoodsSecoundData[item] = editGoodsDetils[item];
|
||||
});
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: e.title
|
||||
// })
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
async searchClick() {
|
||||
const {
|
||||
data
|
||||
} = await productLstApi(this.mer_id, this.params)
|
||||
this.goodsList = data.list
|
||||
},
|
||||
async getGoodsList() {
|
||||
const {
|
||||
data
|
||||
} = await productLstApi(this.mer_id, this.params)
|
||||
this.goodsList.push(...data.list)
|
||||
if (data.length < 9) this.status = 'nomore';
|
||||
},
|
||||
redactShow(item) {
|
||||
this.product_id = item.product_id
|
||||
this.merId = item.mer_id
|
||||
this.redactGoods = item
|
||||
this.popupShow = true
|
||||
productDetail(item.mer_id, item.product_id).then(res => {
|
||||
this.particulars = res.data
|
||||
})
|
||||
// console.log('打开弹框', item);
|
||||
},
|
||||
popupClose() {
|
||||
this.goodsPrive = ''
|
||||
this.goodsNum = ''
|
||||
this.popupShow = false
|
||||
},
|
||||
// 创建商品
|
||||
async submitCreatedGoods() {
|
||||
this.particulars.attrValue[0].stock = Number(this.goodsNum)
|
||||
this.particulars.attrValue[0].price = this.goodsPrive
|
||||
const res = await productUpdate(this.merId, this.product_id, this.particulars)
|
||||
// Toast(message)
|
||||
this.getGoodsList()
|
||||
this.popupShow = false
|
||||
this.goodsPrive = ''
|
||||
this.goodsNum = ''
|
||||
},
|
||||
initData() {
|
||||
let editGoodsDetils = {};
|
||||
if (getStorage('goodsDis')) {
|
||||
this.disModel = true;
|
||||
}
|
||||
if (this.product_id) {
|
||||
editGoodsDetils = getStorage('editGoodsDetils');
|
||||
Object.keys(this.addGoodsSecoundData).forEach(item => {
|
||||
this.addGoodsSecoundData[item] = editGoodsDetils[item];
|
||||
});
|
||||
|
||||
if (editGoodsDetils.content) {
|
||||
setStorage('goodsDis', {
|
||||
store_name: editGoodsDetils.content.title,
|
||||
imageList: editGoodsDetils.content.image
|
||||
});
|
||||
this.disModel = true;
|
||||
}
|
||||
setStorage('canChangeSecound', true);
|
||||
return;
|
||||
}
|
||||
if (editGoodsDetils.content) {
|
||||
setStorage('goodsDis', {
|
||||
store_name: editGoodsDetils.content.title,
|
||||
imageList: editGoodsDetils.content.image
|
||||
});
|
||||
this.disModel = true;
|
||||
}
|
||||
setStorage('canChangeSecound', true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getStorage('addGoodsSecoundData')) {
|
||||
Object.keys(this.addGoodsSecoundData).forEach(item => {
|
||||
if (getStorage('addGoodsSecoundData')[item] || getStorage('addGoodsSecoundData')[item] == 0) {
|
||||
this.addGoodsSecoundData[item] = getStorage('addGoodsSecoundData')[item];
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
// 加载更多
|
||||
onReachBottom() {
|
||||
if (this.status == 'nomore') return;
|
||||
this.status = 'loading';
|
||||
this.params.page = ++this.params.page;
|
||||
this.getGoodsList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.params.page = 1
|
||||
this.goodsList = []
|
||||
this.getGoodsList()
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
}
|
||||
if (getStorage('addGoodsSecoundData')) {
|
||||
Object.keys(this.addGoodsSecoundData).forEach(item => {
|
||||
if (getStorage('addGoodsSecoundData')[item] || getStorage('addGoodsSecoundData')[item] ==
|
||||
0) {
|
||||
this.addGoodsSecoundData[item] = getStorage('addGoodsSecoundData')[item];
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
// 加载更多
|
||||
onReachBottom() {
|
||||
if (this.status == 'nomore') return;
|
||||
this.status = 'loading';
|
||||
this.params.page = ++this.params.page;
|
||||
this.getGoodsList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.params.page = 1
|
||||
this.goodsList = []
|
||||
this.getGoodsList()
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.goods_list {}
|
||||
.goods_list {}
|
||||
|
||||
|
||||
.head_search {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
height: 108.77rpx;
|
||||
.head_search {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
height: 108.77rpx;
|
||||
|
||||
.search_content {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
height: 66.67rpx;
|
||||
padding: 2px 2px 2px 21.05rpx;
|
||||
border: 1px solid $uni-theme-color;
|
||||
border-radius: 100px;
|
||||
.search_content {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
height: 66.67rpx;
|
||||
padding: 2px 2px 2px 21.05rpx;
|
||||
border: 1px solid $uni-theme-color;
|
||||
border-radius: 100px;
|
||||
|
||||
.icon-sousuo {
|
||||
font-weight: bold;
|
||||
color: $uni-theme-color;
|
||||
margin-right: 17.54rpx;
|
||||
}
|
||||
.icon-sousuo {
|
||||
font-weight: bold;
|
||||
color: $uni-theme-color;
|
||||
margin-right: 17.54rpx;
|
||||
}
|
||||
|
||||
.search_btn {
|
||||
color: #fff;
|
||||
width: 135.09rpx;
|
||||
height: 59.65rpx;
|
||||
line-height: 59.65rpx;
|
||||
background: $uni-theme-bg-color;
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.search_btn {
|
||||
color: #fff;
|
||||
width: 135.09rpx;
|
||||
height: 59.65rpx;
|
||||
line-height: 59.65rpx;
|
||||
background: $uni-theme-bg-color;
|
||||
border-radius: 100px;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list_item,
|
||||
.popup_cont {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
// height: 236.84rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 21.05rpx;
|
||||
margin-top: 21.05rpx;
|
||||
.list_item,
|
||||
.popup_cont {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
// height: 236.84rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 21.05rpx;
|
||||
margin-top: 21.05rpx;
|
||||
|
||||
.title {
|
||||
font-size: 31.58rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
|
||||
.list_item {
|
||||
font-size: 24.56rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.redact_box {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
.list_item {
|
||||
font-size: 24.56rpx;
|
||||
|
||||
}
|
||||
.redact_box {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
|
||||
.redact {
|
||||
margin-top: 7.02rpx;
|
||||
color: #fff;
|
||||
width: 129.82rpx;
|
||||
height: 50.88rpx;
|
||||
line-height: 50.88rpx;
|
||||
background: $uni-theme-bg-color;
|
||||
border-radius: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
.r_box {
|
||||
flex: 1;
|
||||
}
|
||||
.redact {
|
||||
margin-top: 7.02rpx;
|
||||
color: #fff;
|
||||
width: 129.82rpx;
|
||||
height: 50.88rpx;
|
||||
line-height: 50.88rpx;
|
||||
background: $uni-theme-bg-color;
|
||||
border-radius: 7px;
|
||||
font-size: 25rpx
|
||||
}
|
||||
|
||||
.unit {
|
||||
margin-left: 35.09rpx;
|
||||
margin: 7.02rpx 0 7.02rpx 35.09rpx;
|
||||
}
|
||||
.r_box {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.goods_img {
|
||||
width: 119.3rpx;
|
||||
height: 119.3rpx;
|
||||
border-radius: 8px;
|
||||
margin-right: 26.32rpx;
|
||||
}
|
||||
}
|
||||
.unit {
|
||||
margin-left: 35.09rpx;
|
||||
margin: 7.02rpx 0 7.02rpx 35.09rpx;
|
||||
}
|
||||
|
||||
.popup_cont {
|
||||
width: 680.7rpx;
|
||||
padding: 31.58rpx;
|
||||
font-size: 28.07rpx;
|
||||
.goods_img {
|
||||
width: 119.3rpx;
|
||||
height: 119.3rpx;
|
||||
border-radius: 8px;
|
||||
margin-right: 26.32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin: 28.07rpx 0 21.05rpx 0;
|
||||
}
|
||||
.goodstitle {
|
||||
width: 42vw;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
/* 不换行 */
|
||||
overflow: hidden;
|
||||
/* 溢出隐藏 */
|
||||
text-overflow: ellipsis;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 31.58rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.sub_title {
|
||||
font-size: 28.07rpx;
|
||||
margin: 35.09rpx 0 14.04rpx 0;
|
||||
}
|
||||
.popup_cont {
|
||||
width: 680.7rpx;
|
||||
padding: 31.58rpx;
|
||||
font-size: 28.07rpx;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 84.21rpx;
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 4px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
.message {
|
||||
margin: 28.07rpx 0 21.05rpx 0;
|
||||
|
||||
.btns_box {
|
||||
margin-top: 49.12rpx;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.cancel {
|
||||
font-size: 31.58rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.save {
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 77.19rpx;
|
||||
margin-left: 57.89rpx;
|
||||
width: 250.88rpx;
|
||||
height: 77.19rpx;
|
||||
background: #009E56;
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.sub_title {
|
||||
font-size: 28.07rpx;
|
||||
margin: 35.09rpx 0 14.04rpx 0;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 84.21rpx;
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 4px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.btns_box {
|
||||
margin-top: 49.12rpx;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.cancel {
|
||||
font-size: 31.58rpx;
|
||||
}
|
||||
|
||||
.save {
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 77.19rpx;
|
||||
margin-left: 57.89rpx;
|
||||
width: 250.88rpx;
|
||||
height: 77.19rpx;
|
||||
background: #009E56;
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -49,7 +49,7 @@
|
||||
</view>
|
||||
<view class="zhezhao">
|
||||
</view>
|
||||
<view class="zhezhao1" @click="goStore(item.mer_id)">
|
||||
<view class="zhezhao1" @click="goStore(item.mer_id)">
|
||||
<view class="title">
|
||||
<view>{{item.mer_name}}
|
||||
</view>
|
||||
@ -189,7 +189,7 @@
|
||||
<image src="@/static/images/guanbi.png" class="guanbi" @click="close"></image>
|
||||
</u-popup>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -289,19 +289,19 @@
|
||||
storeTypeArr: [], //店铺类型
|
||||
merList: [], //商户分类
|
||||
product_type: 0,
|
||||
show:false,
|
||||
image: '' ,//图片,
|
||||
credit_buy:'',//支持先货后款
|
||||
show: false,
|
||||
image: '', //图片,
|
||||
credit_buy: '', //支持先货后款
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
|
||||
|
||||
this.product_type = options.product_type ?? 0
|
||||
if (options.street_id != undefined) {
|
||||
this.sotreParam.street_id = options.street_id
|
||||
}
|
||||
this.credit_buy=options.credit_buy
|
||||
this.credit_buy = options.credit_buy
|
||||
this.sotreParam.type_id = options.type_id
|
||||
this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || ''
|
||||
this.sotreParam.category_id = options.cate_id && options.cate_id.split(',').toString() || ''
|
||||
@ -501,7 +501,7 @@
|
||||
category_id: this.sotreParam.category_id,
|
||||
type_id: this.sotreParam.type_id,
|
||||
street_id: this.sotreParam.street_id,
|
||||
credit_buy:this.credit_buy
|
||||
credit_buy: this.credit_buy
|
||||
}
|
||||
if (this.latitude) {
|
||||
rqData.location = this.latitude + ',' + this.longitude
|
||||
@ -618,7 +618,7 @@
|
||||
this.storeMerchantList()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -627,7 +627,7 @@
|
||||
width: 100%;
|
||||
height: 140rpx;
|
||||
padding: 0 20rpx;
|
||||
padding-top:70rpx ;
|
||||
padding-top: 70rpx;
|
||||
// box-sizing: border-box;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
@ -1130,12 +1130,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.guanbi {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 30px auto;
|
||||
}
|
||||
|
||||
|
||||
.pop {
|
||||
z-index: 1;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<view :style="viewColor">
|
||||
|
||||
<view class='my-order'>
|
||||
<view class='header'>
|
||||
|
||||
<view class='picTxt acea-row row-between-wrapper'>
|
||||
<view class='text'>
|
||||
<view class='name'>订单信息</view>
|
||||
@ -56,22 +58,18 @@
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
99999999
|
||||
<view class='list'>
|
||||
<!-- 代付款 -->
|
||||
<view v-if="orderList.length > 0">
|
||||
<block v-if="orderStatus == 0">
|
||||
<view class='item' v-for="(item,index) in orderList" :key="index">
|
||||
<view @click='goOrderDetails(item.group_order_id,item.orderList[0].activity_type)'>
|
||||
<view @click='goOrderDetails(item.group_order_id)'>
|
||||
<view class='title acea-row row-between-wrapper'>
|
||||
<view class="acea-row row-middle left-wrapper">
|
||||
{{item.group_order_sn}}
|
||||
</view>
|
||||
<view class='t-color' v-if="item.pay_type == 3 || item.pay_type == 1">
|
||||
待付款
|
||||
</view>
|
||||
<view class='t-color' v-if="item.pay_type == 8">
|
||||
待结算
|
||||
<view class='t-color'>
|
||||
{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(order,j) in item.orderList" :key="order.order_id+j">
|
||||
@ -80,7 +78,6 @@
|
||||
<block v-for="(goods,g) in order.orderProduct">
|
||||
<view class='item-info acea-row row-between row-top'>
|
||||
<view class='pictrue'>
|
||||
|
||||
<image
|
||||
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
|
||||
</image>
|
||||
@ -105,15 +102,6 @@
|
||||
</view>
|
||||
<view>x{{goods.product_num}}</view>
|
||||
</view>
|
||||
<view class="money" style="margin-left: 117px;"
|
||||
v-if="item.pay_type == 8">
|
||||
<view class='totalPrice' style="margin-right: 50rpx;">先货后款 实付款:
|
||||
<text class='money p-color'>¥0.00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{goods.cart_info.productAttr.price || item.interest.total_amount}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goods.cart_info.productPresell.presell_type === 2"
|
||||
class="event_price">
|
||||
@ -131,27 +119,16 @@
|
||||
<image
|
||||
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
|
||||
</image>
|
||||
|
||||
</view>
|
||||
|
||||
<view class='text acea-row row-between'>
|
||||
|
||||
<view class='name line2'>{{goods.cart_info.product.store_name}}
|
||||
</view>
|
||||
<view class="name line2">{{goods.cart_info.productAttr.sku}}
|
||||
</view>
|
||||
<view class='money' v-if="item.pay_type == 8">
|
||||
<view>
|
||||
¥{{goods.cart_info.productAttr.price}}</view>
|
||||
|
||||
<view class='money' v-if="item.orderList[0].activity_type == 4">
|
||||
<view v-if="goods.cart_info.activeSku">
|
||||
¥{{goods.cart_info.activeSku.active_price}}</view>
|
||||
<view>x{{goods.product_num}}</view>
|
||||
<!-- <view class="money" style="margin-left: 117px;" v-if="item.pay_type == 8">
|
||||
<view>
|
||||
先货后款,实付:¥0.00
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{goods.cart_info.productAttr.price || item.interest.total_amount}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view v-else class='money'>
|
||||
<view>¥{{goods.cart_info.productAttr.price}}</view>
|
||||
@ -162,32 +139,17 @@
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class='totalPrice' style="margin-right: 20px;" v-if="item.pay_type !== 8">
|
||||
<view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">
|
||||
共{{item.total_num || 0}}件商品,总金额
|
||||
<text class='money p-color'>¥{{item.pay_price}}</text>
|
||||
</view>
|
||||
<view class='totalPrice' style="margin-right: 20px;" v-else>先货后款 实付款:
|
||||
<text class='money p-color'>¥0.00</text>
|
||||
</view>
|
||||
<view class="totalPrice" style="margin-right: 15px;" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{item.interest.total_amount}}
|
||||
</view>
|
||||
<view class='bottom acea-row row-right row-middle'
|
||||
v-if="item.pay_type == 3 || item.pay_type == 1">
|
||||
<view class='bnt cancelBnt' @click.stop='cancelOrder(index,item.group_order_id)'>
|
||||
取消订单</view>
|
||||
<view class='bottom acea-row row-right row-middle'>
|
||||
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
|
||||
立即付款</view>
|
||||
</view>
|
||||
<view class='bottom acea-row row-right row-middle' v-else>
|
||||
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
|
||||
去结算</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 待发货 待收货 待评价 已完成 -->
|
||||
<block v-else>
|
||||
<view class='item' v-for="(item,index) in orderList" :key="index">
|
||||
@ -201,9 +163,10 @@
|
||||
<view v-if="item.status == 0" class='t-color'>
|
||||
<text
|
||||
v-if="item.order_type==1">{{item.takeOrderCount > 0 ? '部分核销' : '待核销'}}</text>
|
||||
<text v-else>待发货</text>
|
||||
<!-- <text v-else>待发货</text> -->
|
||||
</view>
|
||||
{{item.status}}{{item.pay_type}}
|
||||
<view v-if="item.status == 0 && item.pay_type !=3" class='t-color'>待发货</view>
|
||||
<view v-if="item.status == 0 && item.pay_type==3" class='t-color'>待付款</view>
|
||||
<view v-if="item.status == 1" class='t-color'>待收货</view>
|
||||
<view v-if="item.status == 2 && item.pay_type !== 8" class='t-color'>待评价</view>
|
||||
<view v-if="item.status == 3" class='t-color'>已完成</view>
|
||||
@ -215,12 +178,10 @@
|
||||
<view class='item-info acea-row row-between row-top'
|
||||
v-for="(goods,index) in item.orderProduct" :key="index">
|
||||
<view class='pictrue'>
|
||||
|
||||
<image
|
||||
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<view class='text acea-row row-between'>
|
||||
<view class='name '>
|
||||
<view class='name' :class="item.status === 0 ? 'line1' : 'line2'">
|
||||
@ -242,27 +203,13 @@
|
||||
<view class='money'>
|
||||
<view>¥{{goods.cart_info.productPresellAttr.presell_price}}</view>
|
||||
<view>x{{goods.product_num}}</view>
|
||||
<view class="money" style="margin-left: 117px;"
|
||||
v-if="item.pay_type == 0">
|
||||
<view class='totalPrice' style="margin-right: 50rpx;">先货后款 实付款:
|
||||
<text class='money p-color'>¥0.00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{goods.cart_info.productAttr.price || item.interest.total_amount}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-else>
|
||||
|
||||
<view class='item-info acea-row row-between row-top'
|
||||
v-for="(goods,index) in item.orderProduct" :key="index">
|
||||
|
||||
|
||||
<view class='pictrue'>
|
||||
<image
|
||||
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
|
||||
@ -273,9 +220,6 @@
|
||||
<view class='name line2'>
|
||||
<text>{{goods.cart_info.product.store_name}}</text>
|
||||
</view>
|
||||
<view class='name line2'>
|
||||
<text>{{goods.cart_info.productAttr.sku}}</text>
|
||||
</view>
|
||||
<view style="margin-top: 10rpx;" class="t-color">
|
||||
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
|
||||
</view>
|
||||
@ -284,15 +228,6 @@
|
||||
<view v-if="goods.cart_info.productAssistAttr">
|
||||
¥{{goods.cart_info.productAssistAttr.assist_price}}</view>
|
||||
<view>x{{goods.product_num}}</view>
|
||||
<view class="money" style="margin-left: 117px;"
|
||||
v-if="item.pay_type == 8">
|
||||
<view class='totalPrice' style="margin-right: 50rpx;">先货后款 实付款:
|
||||
<text class='money p-color'>¥0.00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{goods.cart_info.productAttr.price || item.interest.total_amount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class='money' v-else-if="item.activity_type == 4">
|
||||
<view v-if="goods.cart_info.activeSku">
|
||||
@ -303,21 +238,14 @@
|
||||
<view>¥{{goods.cart_info.productAttr.price}}</view>
|
||||
<view>x{{goods.product_num}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class='totalPrice' v-if="item.activity_type == 2">
|
||||
共{{item.orderNum || 0}}件商品,总金额
|
||||
<text class='money p-color'>¥{{item.presell_price}}</text>
|
||||
</view>
|
||||
<view class="money" v-if="item.pay_type == 8 ">
|
||||
<view class='totalPrice' style="margin-right: 50rpx;">先货后款 实付款:
|
||||
<text class='money p-color'>¥0.00</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice" style="margin-right: 18px;" v-if="item.pay_type == 8">
|
||||
共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{item.total_price || item.interest.total_amount}}
|
||||
<view class='totalPrice' v-if="item.activity_type == 2">共{{item.orderNum || 0}}件商品,总金额
|
||||
<text class='money p-color'>¥{{item.presell_price}}</text>
|
||||
</view>
|
||||
<view class='totalPrice' v-else>共{{item.orderNum || 0}}件商品,总金额
|
||||
<text class='money p-color'>¥{{item.pay_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='bottom acea-row row-right row-middle'>
|
||||
@ -332,29 +260,22 @@
|
||||
@click='goOrderDetails(item.order_id)'>查看物流</view>
|
||||
<view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view>
|
||||
</block>
|
||||
<!-- <block v-if="item.status == 2 && item.pay_type !== 8 ">
|
||||
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>发布种草
|
||||
</view>
|
||||
</block> -->
|
||||
<navigator v-if=" flag&&item.status == 2 && item.pay_type !== 8"
|
||||
:url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id"
|
||||
class='bnt colorBnt' hover-class="none">
|
||||
<block v-if="item.status == 2">
|
||||
<!-- <navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none">
|
||||
<text class="iconfont icon-fabu"></text>
|
||||
发布种草
|
||||
</navigator>
|
||||
<block v-if="item.status == 2 && item.pay_type !== 8 ">
|
||||
</navigator> -->
|
||||
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.status == 2 && item.pay_type == 8">
|
||||
<view class='bnt b-color' @click='pay_open(item.order_id)'>去结算
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.status == 3">
|
||||
<view class='bnt b-color' @click='goOrderDetails(item.order_id)'
|
||||
v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">
|
||||
查看详情</view>
|
||||
|
||||
<!-- <navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none">
|
||||
<text class="iconfont icon-fabu"></text>
|
||||
发布种草
|
||||
</navigator> -->
|
||||
<view class='bnt b-color' @click='goOrderDetails(item.order_id)' v-else>再次购买</view>
|
||||
</block>
|
||||
</view>
|
||||
@ -362,9 +283,6 @@
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
999999999
|
||||
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>5">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
@ -377,18 +295,6 @@
|
||||
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
|
||||
:totalPrice='totalPrice'></payment>
|
||||
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
|
||||
<u-popup :show="show" bgColor='transparent' mode='center'>
|
||||
<view class="warp">
|
||||
<image @click="close" class="guanbi" src="@/static/images/guanbi.png"></image>
|
||||
<image src="@/static/images/shouhuo.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="textp">
|
||||
<h3>确认收到货了吗?</h3>
|
||||
<span>此订单为先货后款订单,确认收货后将开始计算结算周期。为保障售后权益,请检查后再确认收货。</span>
|
||||
<button class="shouhuobtn" @click="queding()">确认收货</button>
|
||||
<view class="cle" @click="close">取消</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -411,7 +317,7 @@
|
||||
orderPay,
|
||||
groupOrderList,
|
||||
orderTake,
|
||||
applyInvoiceApi,
|
||||
applyInvoiceApi
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
getUserInfo
|
||||
@ -443,7 +349,6 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flag: false,
|
||||
loading: false, //是否加载中
|
||||
loadend: false, //是否加载完毕
|
||||
loadTitle: '加载更多', //提示语
|
||||
@ -476,8 +381,7 @@
|
||||
title: '可用余额:',
|
||||
number: 0,
|
||||
payStatus: this.$store.getters.globalData.yue_pay_status
|
||||
},
|
||||
|
||||
}
|
||||
],
|
||||
pay_close: false,
|
||||
pay_order_id: '',
|
||||
@ -489,15 +393,7 @@
|
||||
invoice: {
|
||||
invoice: false,
|
||||
add: false,
|
||||
},
|
||||
show: false,
|
||||
shouhuo: {
|
||||
index: '',
|
||||
id: ''
|
||||
},
|
||||
//商品分类
|
||||
activity_type: '',
|
||||
product_type: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -513,8 +409,6 @@
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.flag = (this.$route.query.product_type == 0)
|
||||
console.log(this.flag)
|
||||
if (this.isLogin) {
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
@ -531,12 +425,15 @@
|
||||
onReady() {},
|
||||
mounted: function() {},
|
||||
methods: {
|
||||
//去结算
|
||||
pay_open: function(order_id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + this
|
||||
.product_type
|
||||
})
|
||||
// 后退
|
||||
returns() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 首页
|
||||
goHome() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
// 去商铺
|
||||
goMall(item) {
|
||||
@ -589,7 +486,6 @@
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
if (options.status) this.orderStatus = options.status;
|
||||
if (options.product_type) this.product_type = options.product_type;
|
||||
},
|
||||
/**
|
||||
* 获取订单统计数据
|
||||
@ -597,9 +493,7 @@
|
||||
*/
|
||||
getOrderData: function() {
|
||||
let that = this;
|
||||
orderData({
|
||||
product_type: this.product_type
|
||||
}).then(res => {
|
||||
orderData().then(res => {
|
||||
console.log(res.data)
|
||||
that.$set(that, 'orderData', res.data);
|
||||
})
|
||||
@ -634,15 +528,10 @@
|
||||
*
|
||||
*/
|
||||
goPay: function(pay_price, order_id) {
|
||||
console.log(order_id);
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this
|
||||
.product_type
|
||||
});
|
||||
// this.$set(this, 'pay_close', true);
|
||||
// this.order_id = order_id;
|
||||
// this.pay_order_id = order_id.toString()
|
||||
// this.$set(this, 'totalPrice', pay_price);
|
||||
this.$set(this, 'pay_close', true);
|
||||
this.order_id = order_id;
|
||||
this.pay_order_id = order_id.toString()
|
||||
this.$set(this, 'totalPrice', pay_price);
|
||||
},
|
||||
/**
|
||||
* 支付成功回调
|
||||
@ -668,7 +557,7 @@
|
||||
/**
|
||||
* 去订单详情
|
||||
*/
|
||||
goOrderDetails: function(order_id, product_type) {
|
||||
goOrderDetails: function(order_id) {
|
||||
let self = this
|
||||
if (!order_id) return that.$util.Tips({
|
||||
title: '缺少订单号无法查看订单详情'
|
||||
@ -681,8 +570,7 @@
|
||||
uni.hideLoading();
|
||||
if (self.orderStatus == 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' +
|
||||
product_type
|
||||
url: '/pages/order_details/stay?order_id=' + order_id
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
@ -696,8 +584,7 @@
|
||||
// #ifndef MP
|
||||
if (self.orderStatus == 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' +
|
||||
product_type
|
||||
url: '/pages/order_details/stay?order_id=' + order_id
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
@ -764,13 +651,11 @@
|
||||
groupOrderList({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
product_type: that.product_type,
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
that.isReady = true;
|
||||
let list = res.data.return || [];
|
||||
let list = res.data.list || [];
|
||||
let loadend = list.length < that.limit;
|
||||
console.log(that.orderList)
|
||||
// console.log(that.orderList)
|
||||
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
|
||||
.orderList);
|
||||
that.$set(that, 'orderList', that.orderList);
|
||||
@ -786,13 +671,7 @@
|
||||
status: that.orderStatus - 1,
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
product_type: that.product_type,
|
||||
}).then(res => {
|
||||
// res.data.list[0].status=2
|
||||
console.log(res)
|
||||
res.data.list.forEach(item => {
|
||||
console.log([item.status, item.pay_type]);
|
||||
})
|
||||
let list = res.data.list || [];
|
||||
let loadend = list.length < that.limit;
|
||||
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
|
||||
@ -864,26 +743,27 @@
|
||||
},
|
||||
// 确认收货
|
||||
confirmOrder: function(item, index) {
|
||||
this.show = true
|
||||
this.shouhuo.id = item.order_id
|
||||
this.shouhuo.index = index
|
||||
},
|
||||
queding() {
|
||||
let that = this;
|
||||
orderTake(that.shouhuo.id).then(res => {
|
||||
that.show = false
|
||||
that.orderList.splice(that.shouhuo.index, 1);
|
||||
that.getOrderData();
|
||||
return that.$util.Tips({
|
||||
title: '操作成功',
|
||||
icon: 'success',
|
||||
})
|
||||
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
that.show = false
|
||||
uni.showModal({
|
||||
title: '确认收货',
|
||||
content: '为保障权益,请收到货确认无误后,再确认收货',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
orderTake(item.order_id).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: '操作成功',
|
||||
icon: 'success'
|
||||
}, function() {
|
||||
that.orderList.splice(index, 1);
|
||||
that.getOrderData();
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/*申请开票*/
|
||||
@ -911,11 +791,7 @@
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.show = false
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.getOrderList();
|
||||
@ -924,6 +800,13 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.head-menu {
|
||||
height: 50rpx;
|
||||
padding-left: 20rpx;
|
||||
line-height: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.my-order .header {
|
||||
height: 260rpx;
|
||||
padding: 0 30rpx;
|
||||
@ -957,8 +840,6 @@
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.my-order .header .picTxt .pictrue {
|
||||
@ -1056,13 +937,6 @@
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-top: 6rpx;
|
||||
|
||||
.totalPrice {
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
text-align: right;
|
||||
padding-left: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.my-order .list .item .item-info .text .name {
|
||||
@ -1106,8 +980,8 @@
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
text-align: right;
|
||||
margin: 27rpx 0 0 -30rpx;
|
||||
padding: -1px 20rpx 30rpx 0;
|
||||
margin: 27rpx 0 0 30rpx;
|
||||
padding: 0 30rpx 30rpx 0;
|
||||
}
|
||||
|
||||
.my-order .list .item .totalPrice .money {
|
||||
@ -1237,62 +1111,4 @@
|
||||
font-size: 23rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.warp {
|
||||
margin: auto;
|
||||
|
||||
image {}
|
||||
|
||||
.guanbi {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
z-index: 1;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.textp {
|
||||
width: 320px;
|
||||
padding-bottom: 20px;
|
||||
position: absolute;
|
||||
top: 130px;
|
||||
border-radius: 10px;
|
||||
|
||||
h3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
width: 280px;
|
||||
padding-top: 20px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.shouhuobtn {
|
||||
margin: auto;
|
||||
line-height: 54px;
|
||||
margin-top: 30px;
|
||||
width: 191px;
|
||||
height: 54px;
|
||||
color: white;
|
||||
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
|
||||
border-radius: 27px 27px 27px 27px;
|
||||
}
|
||||
|
||||
.cle {
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 10px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.line2 {
|
||||
-webkit-line-clamp: 1;
|
||||
}
|
||||
</style>
|
@ -5,11 +5,13 @@
|
||||
<view class='list'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>姓名</view>
|
||||
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name" placeholder-class='placeholder'></input>
|
||||
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name"
|
||||
placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>联系电话</view>
|
||||
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone' placeholder-class='placeholder'></input>
|
||||
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone'
|
||||
placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>所在地区</view>
|
||||
@ -18,13 +20,14 @@
|
||||
<text v-if="!addressInfo.length" style="color:#cdcdcd;">请选择地址</text>
|
||||
<text v-else>{{addressText}}</text>
|
||||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>详细地址</view>
|
||||
<input type='text' class="location-input" placeholder='请填写具体地址' name='detail' placeholder-class='placeholder' v-model="userAddress.detail"></input>
|
||||
<input type='text' class="location-input" placeholder='请填写具体地址' name='detail'
|
||||
placeholder-class='placeholder' v-model="userAddress.detail"></input>
|
||||
<view class="location" @click="selfLocation">
|
||||
<text class="iconfont icon-chakanditu"></text>
|
||||
<br>
|
||||
@ -35,7 +38,8 @@
|
||||
</view>
|
||||
<view class='default acea-row row-middle'>
|
||||
<checkbox-group @change='ChangeIsDefault'>
|
||||
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址</checkbox-group>
|
||||
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址
|
||||
</checkbox-group>
|
||||
</view>
|
||||
|
||||
<button class='keepBnt' form-type="submit">立即保存</button>
|
||||
@ -43,12 +47,13 @@
|
||||
<view class="wechatAddress" v-if="!address_id" @click="getWxAddress">导入微信地址</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !address_id" @click="getAddress">导入微信地址</view>
|
||||
<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !address_id" @click="getAddress">导入微信地址
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</form>
|
||||
<areaWindow ref="areaWindow" :display="display" :address="addressInfo"
|
||||
@submit="OnChangeAddress" @changeClose="changeClose"></areaWindow>
|
||||
<areaWindow ref="areaWindow" :display="display" :address="addressInfo" @submit="OnChangeAddress"
|
||||
@changeClose="changeClose"></areaWindow>
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
</view>
|
||||
</template>
|
||||
@ -63,11 +68,21 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import { editAddress, getAddressDetail } from '@/api/user.js';
|
||||
import { getCityV2, getCityList } from '@/api/api.js';
|
||||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
editAddress,
|
||||
getAddressDetail
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
getCityV2,
|
||||
getCityList
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import areaWindow from '@/components/areaWindow';
|
||||
import { getGeocoder } from '@/api/store.js';
|
||||
import {
|
||||
getGeocoder
|
||||
} from '@/api/store.js';
|
||||
import authorize from '@/components/Authorize';
|
||||
export default {
|
||||
components: {
|
||||
@ -92,14 +107,15 @@
|
||||
multiIndex: [0, 0, 0],
|
||||
cityId: 0,
|
||||
display: false,
|
||||
addressInfo:[],
|
||||
addressInfo: [],
|
||||
latitude: '',
|
||||
longitude: ''
|
||||
};
|
||||
},
|
||||
computed: {...mapGetters(['isLogin','viewColor']),
|
||||
addressText(){
|
||||
return this.addressInfo.map(v=>v.name).join('/');
|
||||
computed: {
|
||||
...mapGetters(['isLogin', 'viewColor']),
|
||||
addressText() {
|
||||
return this.addressInfo.map(v => v.name).join('/');
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -119,7 +135,7 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
OnChangeAddress(address){
|
||||
OnChangeAddress(address) {
|
||||
this.addressInfo = address;
|
||||
},
|
||||
// 地址数据
|
||||
@ -129,7 +145,7 @@
|
||||
this.district = res.data
|
||||
})
|
||||
},
|
||||
changeRegion(){
|
||||
changeRegion() {
|
||||
this.display = true;
|
||||
},
|
||||
// 关闭地址弹窗;
|
||||
@ -170,7 +186,8 @@
|
||||
success: function(res) {
|
||||
uni.chooseAddress({
|
||||
success: function(res) {
|
||||
getCityList(res.provinceName+'/'+res.cityName+'/'+res.countyName).then(res=>{
|
||||
getCityList(res.provinceName + '/' + res.cityName + '/' + res
|
||||
.countyName).then(res => {
|
||||
that.addressInfo = res.data;
|
||||
})
|
||||
that.userAddress.real_name = res.userName;
|
||||
@ -183,9 +200,10 @@
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
|
||||
title: '取消选择'
|
||||
});
|
||||
if (res.errMsg == 'chooseAddress:cancel') return that.$util
|
||||
.Tips({
|
||||
title: '取消选择'
|
||||
});
|
||||
},
|
||||
})
|
||||
},
|
||||
@ -212,7 +230,7 @@
|
||||
getAddress() {
|
||||
let that = this;
|
||||
that.$wechat.openAddress().then(res => {
|
||||
getCityList(res.provinceName+'/'+res.cityName+'/'+res.countryName).then(res=>{
|
||||
getCityList(res.provinceName + '/' + res.cityName + '/' + res.countryName).then(res => {
|
||||
that.addressInfo = res.data;
|
||||
})
|
||||
that.userAddress.real_name = res.userName;
|
||||
@ -222,14 +240,17 @@
|
||||
// console.log(err);
|
||||
});
|
||||
},
|
||||
|
||||
selfLocation() {
|
||||
console.log(66)
|
||||
let self = this
|
||||
uni.showLoading({
|
||||
title: '定位中',
|
||||
mask: true,
|
||||
});
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
type: 'wgs84',
|
||||
timeout: '10',
|
||||
success: (res) => {
|
||||
let latitude, longitude;
|
||||
latitude = res.latitude.toString();
|
||||
@ -241,11 +262,15 @@
|
||||
long: longitude
|
||||
}).then(res => {
|
||||
const data = res.data;
|
||||
getCityList(data.address_component.province+'/'+data.address_component.city+'/'+data.address_component.district+'/'+(!data.address_reference.town ? '' : data.address_reference.town.title)).then(res=>{
|
||||
getCityList(data.address_component.province + '/' + data.address_component
|
||||
.city + '/' + data.address_component.district + '/' + (!data
|
||||
.address_reference.town ? '' : data.address_reference.town
|
||||
.title)).then(res => {
|
||||
self.addressInfo = res.data;
|
||||
self.$set(self.userAddress, 'detail', data.formatted_addresses.recommend);
|
||||
self.$set(self.userAddress, 'detail', data.formatted_addresses
|
||||
.recommend);
|
||||
uni.hideLoading();
|
||||
}).catch(e=>{
|
||||
}).catch(e => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '定位失败,请手动输入地址',
|
||||
@ -253,7 +278,7 @@
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
}).catch(e=>{
|
||||
}).catch(e => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '定位失败,请手动输入地址',
|
||||
@ -323,8 +348,10 @@
|
||||
that.couponId = '';
|
||||
uni.$emit('updataAddress')
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data
|
||||
.address_id) + '&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId +
|
||||
'&addressId=' + (that.id ? that.id : res.data
|
||||
.address_id) + '&pinkId=' + pinkId + '&couponId=' +
|
||||
couponId
|
||||
});
|
||||
} else {
|
||||
// #ifdef H5
|
||||
@ -353,74 +380,92 @@
|
||||
<style scoped lang="scss">
|
||||
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
|
||||
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||
border: 1px solid var(--view-theme)!important;
|
||||
background-color: var(--view-theme)!important;
|
||||
color: #fff!important;
|
||||
border: 1px solid var(--view-theme) !important;
|
||||
background-color: var(--view-theme) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.addAddress .list {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.addAddress .list .item {
|
||||
padding: 30rpx;
|
||||
border-top: 1px solid #eee;
|
||||
position: relative;
|
||||
}
|
||||
.addAddress .list .item .location{
|
||||
|
||||
.addAddress .list .item .location {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 15rpx;
|
||||
text-align: center;
|
||||
font-size: 20rpx;
|
||||
.iconfont{
|
||||
|
||||
.iconfont {
|
||||
color: var(--view-theme);
|
||||
}
|
||||
}
|
||||
|
||||
.addAddress .list .item .name {
|
||||
width: 195rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.addAddress .list .item .address {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.addAddress .list .item input,.region .region_count {
|
||||
|
||||
.addAddress .list .item input,
|
||||
.region .region_count {
|
||||
width: 475rpx;
|
||||
font-size: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.region .region_count{
|
||||
|
||||
.region .region_count {
|
||||
height: 42rpx;
|
||||
line-height: 42rpx;
|
||||
.icon-xiangyou{
|
||||
|
||||
.icon-xiangyou {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.addAddress .list .location-input{
|
||||
|
||||
.addAddress .list .location-input {
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item .placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker {
|
||||
width: 475rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .picker {
|
||||
width: 410rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .iconfont {
|
||||
font-size: 43rpx;
|
||||
}
|
||||
|
||||
.addAddress .default {
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 23rpx;
|
||||
}
|
||||
|
||||
.addAddress .default checkbox {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.addAddress .keepBnt {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
@ -432,6 +477,7 @@
|
||||
color: #fff;
|
||||
background-color: var(--view-theme);
|
||||
}
|
||||
|
||||
.addAddress .wechatAddress {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
@ -443,4 +489,4 @@
|
||||
color: var(--view-theme);
|
||||
border: 1px solid var(--view-theme);
|
||||
}
|
||||
</style>
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user