页面修改

This commit is contained in:
THK3121 2023-08-04 18:16:03 +08:00
parent da13b53bbd
commit 74377c7dd8
5 changed files with 1516 additions and 1806 deletions

View File

@ -1,334 +1,358 @@
<template> <template>
<view class="goods_list"> <view class="goods_list">
<view class="head_search flex_a_c"> <view class="head_search flex_a_c">
<view class="search_content flex_a_c_j_sb"> <view class="search_content flex_a_c_j_sb">
<view class="flex_a_c"> <view class="flex_a_c">
<view class="iconfont icon-sousuo"></view> <view class="iconfont icon-sousuo"></view>
<input type="text" v-model="params.keyword" placeholder="请搜索"> <input type="text" v-model="params.keyword" placeholder="请搜索">
</view> </view>
<button class="search_btn" @click="searchClick">搜索</button> <button class="search_btn" @click="searchClick">搜索</button>
</view> </view>
</view> </view>
<block v-for="(item,i) in goodsList" :key="i"> <block v-for="(item,i) in goodsList" :key="i">
<view class="list_item flex_a_c"> <view class="list_item flex_a_c">
<image class="goods_img" :src="item.image" mode="aspectFill"></image> <image class="goods_img" :src="item.image" mode="aspectFill"></image>
<view class="r_box flex_a_c_j_sb"> <view class="r_box flex_a_c_j_sb">
<view class="message"> <view class="message">
<view class="title">{{item.store_name}}</view> <view class="goodstitle">{{item.store_name}}</view>
<view class="flex_a_c"> <view class="flex_a_c">
<view class="">分类{{item.storeCategory.cate_name}}</view> <view class="">分类{{item.storeCategory.cate_name}}</view>
<view class="unit">单位{{item.unit_name}}</view> <view class="unit">单位{{item.unit_name}}</view>
</view> </view>
<view class="bar_code">条形码{{ item.bar_code || "0" }}</view> <view class="bar_code">条形码{{ item.bar_code || "" }}</view>
</view> </view>
<view class="redact_box"> <view class="redact_box">
<view class="order_price">订货价{{item.price}}</view> <view class="order_price">订货价{{item.price}}</view>
<button class="redact" @click="redactShow(item)">编辑</button> <button class="redact" @click="redactShow(item)">编辑</button>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
<u-popup :show="popupShow" @close="popupShow = false" mode="center" :round="10" closeOnClickOverlay> <u-popup :show="popupShow" @close="popupShow = false" mode="center" :round="10" closeOnClickOverlay>
<view class="popup_cont" v-if="redactGoods.store_name"> <view class="popup_cont" v-if="redactGoods.store_name">
<view class="title">{{redactGoods.store_name}}</view> <view class="title">{{redactGoods.store_name}}</view>
<view class="message flex_a_c_j_sb"> <view class="message flex_a_c_j_sb">
<view class="">分类{{redactGoods.storeCategory.cate_name}}</view> <view class="">分类{{redactGoods.storeCategory.cate_name}}</view>
<view class="">单位{{redactGoods.unit_name}}</view> <view class="">单位{{redactGoods.unit_name}}</view>
<view class="">订货价{{redactGoods.price}}</view> <view class="">订货价{{redactGoods.price}}</view>
</view> </view>
<view class="bar_code flex_a_c_j_sb"> <view class="bar_code flex_a_c_j_sb">
<view>条形码{{ redactGoods.bar_code || "0" }}</view> <view>条形码{{ redactGoods.bar_code || "" }}</view>
<view>库存{{ redactGoods.stock }}</view> <view>库存{{ redactGoods.stock }}</view>
</view> </view>
<view class="sub_title">订货价</view> <view class="sub_title">订货价</view>
<input class="input" type="text" placeholder="请输入价格" v-model="goodsPrive"> <input class="input" type="text" placeholder="请输入价格" v-model="goodsPrive">
<view class="sub_title">库存量</view> <view class="sub_title">库存量</view>
<input class="input" type="number" placeholder="请输入库存数量" v-model="goodsNum"> <input class="input" type="number" placeholder="请输入库存数量" v-model="goodsNum">
<view class="btns_box"> <view class="btns_box">
<view class="cancel" @click="popupClose">取消</view> <view class="cancel" @click="popupClose">取消</view>
<view class="save" @click="submitCreatedGoods">保存</view> <view class="save" @click="submitCreatedGoods">保存</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
import { import {
getStorage, getStorage,
removeStorage, removeStorage,
Toast, Toast,
Loading, Loading,
hideLoading, hideLoading,
Modal Modal
} from '@/libs/uniApi.js'; } from '@/libs/uniApi.js';
import { productLstApi, productCreate, productUpdate, productDetail } from '@/api/product.js' import {
import { checkLogin } from '../../../libs/login'; productLstApi,
export default { productCreate,
data() { productUpdate,
return { productDetail
goodsPrive: '', } from '@/api/product.js'
goodsNum: '', import {
goodsList: [], checkLogin
redactGoods: {}, } from '../../../libs/login';
search: '', export default {
popupShow: false, data() {
merId: '', return {
product_id: '', goodsPrive: '',
addGoodsSecoundData: { goodsNum: '',
is_good: 0, // goodsList: [],
is_gift_bag: 0, redactGoods: {},
sort: '', search: '',
once_count: '', // popupShow: false,
video_link: '' merId: '',
}, product_id: '',
disModel: false, addGoodsSecoundData: {
particulars: {}, is_good: 0, //
mer_id: '', is_gift_bag: 0,
status: 'loadmore', sort: '',
loadingText: '努力加载中', once_count: '', //
loadmoreText: '轻轻上拉', video_link: ''
nomoreText: '实在没有了', },
params: { disModel: false,
page: 1, particulars: {},
limit: 10, mer_id: '',
keyword: '' status: 'loadmore',
}, loadingText: '努力加载中',
// page: 1, loadmoreText: '轻轻上拉',
} nomoreText: '实在没有了',
}, params: {
onLoad(e) { page: 1,
this.mer_id = e.merid limit: 10,
this.getGoodsList() keyword: ''
this.initData(); },
// page: 1,
}
},
onLoad(e) {
this.mer_id = e.merid
this.getGoodsList()
this.initData();
// uni.setNavigationBarTitle({ // uni.setNavigationBarTitle({
// title: e.title // title: e.title
// }) // })
}, },
onShow() {}, onShow() {},
methods: { methods: {
async searchClick() { async searchClick() {
const { data } = await productLstApi(this.mer_id, this.params) const {
this.goodsList = data.list data
}, } = await productLstApi(this.mer_id, this.params)
async getGoodsList() { this.goodsList = data.list
const { data } = await productLstApi(this.mer_id, this.params) },
this.goodsList.push(...data.list) async getGoodsList() {
if (data.length < 9) this.status = 'nomore'; const {
}, data
redactShow(item) { } = await productLstApi(this.mer_id, this.params)
this.product_id = item.product_id this.goodsList.push(...data.list)
this.merId = item.mer_id if (data.length < 9) this.status = 'nomore';
this.redactGoods = item },
this.popupShow = true redactShow(item) {
productDetail(item.mer_id, item.product_id).then(res => { this.product_id = item.product_id
this.particulars = res.data this.merId = item.mer_id
}) this.redactGoods = item
// console.log('', item); this.popupShow = true
}, productDetail(item.mer_id, item.product_id).then(res => {
popupClose() { this.particulars = res.data
this.goodsPrive = '' })
this.goodsNum = '' // console.log('', item);
this.popupShow = false },
}, popupClose() {
// this.goodsPrive = ''
async submitCreatedGoods() { this.goodsNum = ''
this.particulars.attrValue[0].stock = Number(this.goodsNum) this.popupShow = false
this.particulars.attrValue[0].price = this.goodsPrive },
const res = await productUpdate(this.merId, this.product_id, this.particulars) //
// Toast(message) async submitCreatedGoods() {
this.getGoodsList() this.particulars.attrValue[0].stock = Number(this.goodsNum)
this.popupShow = false this.particulars.attrValue[0].price = this.goodsPrive
this.goodsPrive = '' const res = await productUpdate(this.merId, this.product_id, this.particulars)
this.goodsNum = '' // Toast(message)
}, this.getGoodsList()
initData() { this.popupShow = false
let editGoodsDetils = {}; this.goodsPrive = ''
if (getStorage('goodsDis')) { this.goodsNum = ''
this.disModel = true; },
} initData() {
if (this.product_id) { let editGoodsDetils = {};
editGoodsDetils = getStorage('editGoodsDetils'); if (getStorage('goodsDis')) {
Object.keys(this.addGoodsSecoundData).forEach(item => { this.disModel = true;
this.addGoodsSecoundData[item] = editGoodsDetils[item]; }
}); if (this.product_id) {
editGoodsDetils = getStorage('editGoodsDetils');
Object.keys(this.addGoodsSecoundData).forEach(item => {
this.addGoodsSecoundData[item] = editGoodsDetils[item];
});
if (editGoodsDetils.content) { if (editGoodsDetils.content) {
setStorage('goodsDis', { setStorage('goodsDis', {
store_name: editGoodsDetils.content.title, store_name: editGoodsDetils.content.title,
imageList: editGoodsDetils.content.image imageList: editGoodsDetils.content.image
}); });
this.disModel = true; this.disModel = true;
} }
setStorage('canChangeSecound', true); setStorage('canChangeSecound', true);
return; return;
} }
if (getStorage('addGoodsSecoundData')) { if (getStorage('addGoodsSecoundData')) {
Object.keys(this.addGoodsSecoundData).forEach(item => { Object.keys(this.addGoodsSecoundData).forEach(item => {
if (getStorage('addGoodsSecoundData')[item] || getStorage('addGoodsSecoundData')[item] == 0) { if (getStorage('addGoodsSecoundData')[item] || getStorage('addGoodsSecoundData')[item] ==
this.addGoodsSecoundData[item] = getStorage('addGoodsSecoundData')[item]; 0) {
} this.addGoodsSecoundData[item] = getStorage('addGoodsSecoundData')[item];
}); }
} });
}, }
}, },
// },
onReachBottom() { //
if (this.status == 'nomore') return; onReachBottom() {
this.status = 'loading'; if (this.status == 'nomore') return;
this.params.page = ++this.params.page; this.status = 'loading';
this.getGoodsList() this.params.page = ++this.params.page;
}, this.getGoodsList()
onPullDownRefresh() { },
this.params.page = 1 onPullDownRefresh() {
this.goodsList = [] this.params.page = 1
this.getGoodsList() this.goodsList = []
uni.stopPullDownRefresh() this.getGoodsList()
} uni.stopPullDownRefresh()
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods_list {} .goods_list {}
.head_search { .head_search {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
height: 108.77rpx; height: 108.77rpx;
.search_content { .search_content {
margin: 0 auto; margin: 0 auto;
width: 694.74rpx; width: 694.74rpx;
height: 66.67rpx; height: 66.67rpx;
padding: 2px 2px 2px 21.05rpx; padding: 2px 2px 2px 21.05rpx;
border: 1px solid $uni-theme-color; border: 1px solid $uni-theme-color;
border-radius: 100px; border-radius: 100px;
.icon-sousuo { .icon-sousuo {
font-weight: bold; font-weight: bold;
color: $uni-theme-color; color: $uni-theme-color;
margin-right: 17.54rpx; margin-right: 17.54rpx;
} }
.search_btn { .search_btn {
color: #fff; color: #fff;
width: 135.09rpx; width: 135.09rpx;
height: 59.65rpx; height: 59.65rpx;
line-height: 59.65rpx; line-height: 59.65rpx;
background: $uni-theme-bg-color; background: $uni-theme-bg-color;
border-radius: 100px; border-radius: 100px;
} font-size: 25rpx;
} }
} }
}
.list_item, .list_item,
.popup_cont { .popup_cont {
margin: 0 auto; margin: 0 auto;
width: 694.74rpx; width: 694.74rpx;
// height: 236.84rpx; // height: 236.84rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 8px; border-radius: 8px;
padding: 21.05rpx; padding: 21.05rpx;
margin-top: 21.05rpx; margin-top: 21.05rpx;
.title { .title {
font-size: 31.58rpx;
font-weight: bold;
color: #333;
}
}
.list_item { font-weight: bold;
font-size: 24.56rpx; color: #333;
}
}
.redact_box { .list_item {
height: 100%; font-size: 24.56rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
} .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 { .redact {
flex: 1; 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 { .r_box {
margin-left: 35.09rpx; flex: 1;
margin: 7.02rpx 0 7.02rpx 35.09rpx; }
}
.goods_img { .unit {
width: 119.3rpx; margin-left: 35.09rpx;
height: 119.3rpx; margin: 7.02rpx 0 7.02rpx 35.09rpx;
border-radius: 8px; }
margin-right: 26.32rpx;
}
}
.popup_cont { .goods_img {
width: 680.7rpx; width: 119.3rpx;
padding: 31.58rpx; height: 119.3rpx;
font-size: 28.07rpx; border-radius: 8px;
margin-right: 26.32rpx;
}
}
.message { .goodstitle {
margin: 28.07rpx 0 21.05rpx 0; 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 { .popup_cont {
font-size: 28.07rpx; width: 680.7rpx;
margin: 35.09rpx 0 14.04rpx 0; padding: 31.58rpx;
} font-size: 28.07rpx;
.input { .message {
width: 100%; margin: 28.07rpx 0 21.05rpx 0;
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; .sub_title {
margin-left: 57.89rpx; font-size: 28.07rpx;
width: 250.88rpx; margin: 35.09rpx 0 14.04rpx 0;
height: 77.19rpx; }
background: #009E56;
border-radius: 100px; .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> </style>

View File

@ -49,7 +49,7 @@
</view> </view>
<view class="zhezhao"> <view class="zhezhao">
</view> </view>
<view class="zhezhao1" @click="goStore(item.mer_id)"> <view class="zhezhao1" @click="goStore(item.mer_id)">
<view class="title"> <view class="title">
<view>{{item.mer_name}} <view>{{item.mer_name}}
</view> </view>
@ -289,9 +289,9 @@
storeTypeArr: [], // storeTypeArr: [], //
merList: [], // merList: [], //
product_type: 0, product_type: 0,
show:false, show: false,
image: '' ,//, image: '', //,
credit_buy:'',// credit_buy: '', //
}; };
}, },
onLoad(options) { onLoad(options) {
@ -301,7 +301,7 @@
if (options.street_id != undefined) { if (options.street_id != undefined) {
this.sotreParam.street_id = options.street_id 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
this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || '' this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || ''
this.sotreParam.category_id = options.cate_id && options.cate_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, category_id: this.sotreParam.category_id,
type_id: this.sotreParam.type_id, type_id: this.sotreParam.type_id,
street_id: this.sotreParam.street_id, street_id: this.sotreParam.street_id,
credit_buy:this.credit_buy credit_buy: this.credit_buy
} }
if (this.latitude) { if (this.latitude) {
rqData.location = this.latitude + ',' + this.longitude rqData.location = this.latitude + ',' + this.longitude
@ -627,7 +627,7 @@
width: 100%; width: 100%;
height: 140rpx; height: 140rpx;
padding: 0 20rpx; padding: 0 20rpx;
padding-top:70rpx ; padding-top: 70rpx;
// box-sizing: border-box; // box-sizing: border-box;
position: fixed; position: fixed;
left: 0; left: 0;
@ -1130,6 +1130,7 @@
} }
} }
} }
.guanbi { .guanbi {
width: 20px; width: 20px;
height: 20px; height: 20px;

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,9 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view class='my-order'> <view class='my-order'>
<view class='header'> <view class='header'>
<view class='picTxt acea-row row-between-wrapper'> <view class='picTxt acea-row row-between-wrapper'>
<view class='text'> <view class='text'>
<view class='name'>订单信息</view> <view class='name'>订单信息</view>
@ -56,22 +58,18 @@
</view> </view>
</navigator> </navigator>
</view> </view>
99999999
<view class='list'> <view class='list'>
<!-- 代付款 --> <!-- 代付款 -->
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<block v-if="orderStatus == 0"> <block v-if="orderStatus == 0">
<view class='item' v-for="(item,index) in orderList" :key="index"> <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='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper"> <view class="acea-row row-middle left-wrapper">
{{item.group_order_sn}} {{item.group_order_sn}}
</view> </view>
<view class='t-color' v-if="item.pay_type == 3 || item.pay_type == 1"> <view class='t-color'>
待付款 {{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view>
<view class='t-color' v-if="item.pay_type == 8">
待结算
</view> </view>
</view> </view>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j"> <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"> <block v-for="(goods,g) in order.orderProduct">
<view class='item-info acea-row row-between row-top'> <view class='item-info acea-row row-between row-top'>
<view class='pictrue'> <view class='pictrue'>
<image <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'> :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image> </image>
@ -105,15 +102,6 @@
</view> </view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</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>
<view v-if="goods.cart_info.productPresell.presell_type === 2" <view v-if="goods.cart_info.productPresell.presell_type === 2"
class="event_price"> class="event_price">
@ -131,27 +119,16 @@
<image <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'> :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image> </image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name line2'>{{goods.cart_info.product.store_name}} <view class='name line2'>{{goods.cart_info.product.store_name}}
</view> </view>
<view class="name line2">{{goods.cart_info.productAttr.sku}}
</view> <view class='money' v-if="item.orderList[0].activity_type == 4">
<view class='money' v-if="item.pay_type == 8"> <view v-if="goods.cart_info.activeSku">
<view> {{goods.cart_info.activeSku.active_price}}</view>
{{goods.cart_info.productAttr.price}}</view>
<view>x{{goods.product_num}}</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>
<view v-else class='money'> <view v-else class='money'>
<view>{{goods.cart_info.productAttr.price}}</view> <view>{{goods.cart_info.productAttr.price}}</view>
@ -162,32 +139,17 @@
</block> </block>
</view> </view>
</view> </view>
<view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">
<view class='totalPrice' style="margin-right: 20px;" v-if="item.pay_type !== 8">
{{item.total_num || 0}}件商品总金额 {{item.total_num || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text> <text class='money p-color'>{{item.pay_price}}</text>
</view> </view>
<view class='totalPrice' style="margin-right: 20px;" v-else>先货后款 实付款: <view class='bottom acea-row row-right row-middle'>
<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='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'> <view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
立即付款</view> 立即付款</view>
</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>
</view> </view>
</block> </block>
<!-- 待发货 待收货 待评价 已完成 --> <!-- 待发货 待收货 待评价 已完成 -->
<block v-else> <block v-else>
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
@ -201,9 +163,10 @@
<view v-if="item.status == 0" class='t-color'> <view v-if="item.status == 0" class='t-color'>
<text <text
v-if="item.order_type==1">{{item.takeOrderCount > 0 ? '部分核销' : '待核销'}}</text> v-if="item.order_type==1">{{item.takeOrderCount > 0 ? '部分核销' : '待核销'}}</text>
<text v-else>待发货</text> <!-- <text v-else>待发货</text> -->
</view> </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 == 1" class='t-color'>待收货</view>
<view v-if="item.status == 2 && item.pay_type !== 8" 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> <view v-if="item.status == 3" class='t-color'>已完成</view>
@ -215,12 +178,10 @@
<view class='item-info acea-row row-between row-top' <view class='item-info acea-row row-between row-top'
v-for="(goods,index) in item.orderProduct" :key="index"> v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'> :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image> </image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name '> <view class='name '>
<view class='name' :class="item.status === 0 ? 'line1' : 'line2'"> <view class='name' :class="item.status === 0 ? 'line1' : 'line2'">
@ -242,27 +203,13 @@
<view class='money'> <view class='money'>
<view>{{goods.cart_info.productPresellAttr.presell_price}}</view> <view>{{goods.cart_info.productPresellAttr.presell_price}}</view>
<view>x{{goods.product_num}}</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> </view>
</view> </view>
<view v-else> <view v-else>
<view class='item-info acea-row row-between row-top' <view class='item-info acea-row row-between row-top'
v-for="(goods,index) in item.orderProduct" :key="index"> v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'> :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
@ -273,9 +220,6 @@
<view class='name line2'> <view class='name line2'>
<text>{{goods.cart_info.product.store_name}}</text> <text>{{goods.cart_info.product.store_name}}</text>
</view> </view>
<view class='name line2'>
<text>{{goods.cart_info.productAttr.sku}}</text>
</view>
<view style="margin-top: 10rpx;" class="t-color"> <view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}} {{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view> </view>
@ -284,15 +228,6 @@
<view v-if="goods.cart_info.productAssistAttr"> <view v-if="goods.cart_info.productAssistAttr">
{{goods.cart_info.productAssistAttr.assist_price}}</view> {{goods.cart_info.productAssistAttr.assist_price}}</view>
<view>x{{goods.product_num}}</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>
<view class='money' v-else-if="item.activity_type == 4"> <view class='money' v-else-if="item.activity_type == 4">
<view v-if="goods.cart_info.activeSku"> <view v-if="goods.cart_info.activeSku">
@ -303,21 +238,14 @@
<view>{{goods.cart_info.productAttr.price}}</view> <view>{{goods.cart_info.productAttr.price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</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>
</view> </view>
<view class="totalPrice" style="margin-right: 18px;" v-if="item.pay_type == 8"> <view class='totalPrice' v-if="item.activity_type == 2">{{item.orderNum || 0}}件商品总金额
{{item.total_num || 0}}件商品结算周期到期后付款{{item.total_price || item.interest.total_amount}} <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> </view>
<view class='bottom acea-row row-right row-middle'> <view class='bottom acea-row row-right row-middle'>
@ -332,29 +260,22 @@
@click='goOrderDetails(item.order_id)'>查看物流</view> @click='goOrderDetails(item.order_id)'>查看物流</view>
<view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view> <view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view>
</block> </block>
<!-- <block v-if="item.status == 2 && item.pay_type !== 8 "> <block v-if="item.status == 2">
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>发布种草 <!-- <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">
</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">
<text class="iconfont icon-fabu"></text> <text class="iconfont icon-fabu"></text>
发布种草 发布种草
</navigator> </navigator> -->
<block v-if="item.status == 2 && item.pay_type !== 8 ">
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价 <view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价
</view> </view>
</block> </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"> <block v-if="item.status == 3">
<view class='bnt b-color' @click='goOrderDetails(item.order_id)' <view class='bnt b-color' @click='goOrderDetails(item.order_id)'
v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10"> v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">
查看详情</view> 查看详情</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> <view class='bnt b-color' @click='goOrderDetails(item.order_id)' v-else>再次购买</view>
</block> </block>
</view> </view>
@ -362,9 +283,6 @@
</block> </block>
</view> </view>
</view> </view>
999999999
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>5"> <view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>5">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}} <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view> </view>
@ -377,18 +295,6 @@
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
:totalPrice='totalPrice'></payment> :totalPrice='totalPrice'></payment>
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing> <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> </view>
</template> </template>
@ -411,7 +317,7 @@
orderPay, orderPay,
groupOrderList, groupOrderList,
orderTake, orderTake,
applyInvoiceApi, applyInvoiceApi
} from '@/api/order.js'; } from '@/api/order.js';
import { import {
getUserInfo getUserInfo
@ -443,7 +349,6 @@
}, },
data() { data() {
return { return {
flag: false,
loading: false, // loading: false, //
loadend: false, // loadend: false, //
loadTitle: '加载更多', // loadTitle: '加载更多', //
@ -476,8 +381,7 @@
title: '可用余额:', title: '可用余额:',
number: 0, number: 0,
payStatus: this.$store.getters.globalData.yue_pay_status payStatus: this.$store.getters.globalData.yue_pay_status
}, }
], ],
pay_close: false, pay_close: false,
pay_order_id: '', pay_order_id: '',
@ -489,15 +393,7 @@
invoice: { invoice: {
invoice: false, invoice: false,
add: false, add: false,
}, }
show: false,
shouhuo: {
index: '',
id: ''
},
//
activity_type: '',
product_type: 0
}; };
}, },
computed: { computed: {
@ -513,8 +409,6 @@
} }
}, },
onShow() { onShow() {
this.flag = (this.$route.query.product_type == 0)
console.log(this.flag)
if (this.isLogin) { if (this.isLogin) {
this.page = 1; this.page = 1;
this.loadend = false; this.loadend = false;
@ -531,12 +425,15 @@
onReady() {}, onReady() {},
mounted: function() {}, mounted: function() {},
methods: { methods: {
// // 退
pay_open: function(order_id) { returns() {
uni.navigateTo({ uni.navigateBack()
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + this },
.product_type //
}) goHome() {
uni.switchTab({
url: '/pages/index/index'
});
}, },
// //
goMall(item) { goMall(item) {
@ -589,7 +486,6 @@
*/ */
onLoad: function(options) { onLoad: function(options) {
if (options.status) this.orderStatus = options.status; if (options.status) this.orderStatus = options.status;
if (options.product_type) this.product_type = options.product_type;
}, },
/** /**
* 获取订单统计数据 * 获取订单统计数据
@ -597,9 +493,7 @@
*/ */
getOrderData: function() { getOrderData: function() {
let that = this; let that = this;
orderData({ orderData().then(res => {
product_type: this.product_type
}).then(res => {
console.log(res.data) console.log(res.data)
that.$set(that, 'orderData', res.data); that.$set(that, 'orderData', res.data);
}) })
@ -634,15 +528,10 @@
* *
*/ */
goPay: function(pay_price, order_id) { goPay: function(pay_price, order_id) {
console.log(order_id); this.$set(this, 'pay_close', true);
uni.navigateTo({ this.order_id = order_id;
url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this this.pay_order_id = order_id.toString()
.product_type 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 let self = this
if (!order_id) return that.$util.Tips({ if (!order_id) return that.$util.Tips({
title: '缺少订单号无法查看订单详情' title: '缺少订单号无法查看订单详情'
@ -681,8 +570,7 @@
uni.hideLoading(); uni.hideLoading();
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + url: '/pages/order_details/stay?order_id=' + order_id
product_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
@ -696,8 +584,7 @@
// #ifndef MP // #ifndef MP
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + url: '/pages/order_details/stay?order_id=' + order_id
product_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
@ -764,13 +651,11 @@
groupOrderList({ groupOrderList({
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
product_type: that.product_type,
}).then(res => { }).then(res => {
console.log(res);
that.isReady = true; that.isReady = true;
let list = res.data.return || []; let list = res.data.list || [];
let loadend = list.length < that.limit; 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 that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
.orderList); .orderList);
that.$set(that, 'orderList', that.orderList); that.$set(that, 'orderList', that.orderList);
@ -786,13 +671,7 @@
status: that.orderStatus - 1, status: that.orderStatus - 1,
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
product_type: that.product_type,
}).then(res => { }).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 list = res.data.list || [];
let loadend = list.length < that.limit; let loadend = list.length < that.limit;
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
@ -864,26 +743,27 @@
}, },
// //
confirmOrder: function(item, index) { confirmOrder: function(item, index) {
this.show = true
this.shouhuo.id = item.order_id
this.shouhuo.index = index
},
queding() {
let that = this; let that = this;
orderTake(that.shouhuo.id).then(res => { uni.showModal({
that.show = false title: '确认收货',
that.orderList.splice(that.shouhuo.index, 1); content: '为保障权益,请收到货确认无误后,再确认收货',
that.getOrderData(); success: function(res) {
return that.$util.Tips({ if (res.confirm) {
title: '操作成功', orderTake(item.order_id).then(res => {
icon: 'success', return that.$util.Tips({
}) title: '操作成功',
icon: 'success'
}).catch(err => { }, function() {
return that.$util.Tips({ that.orderList.splice(index, 1);
title: err that.getOrderData();
}); });
that.show = false }).catch(err => {
return that.$util.Tips({
title: err
});
})
}
}
}) })
}, },
/*申请开票*/ /*申请开票*/
@ -911,11 +791,7 @@
title: err title: err
}); });
}) })
}, }
close() {
this.show = false
},
}, },
onReachBottom: function() { onReachBottom: function() {
this.getOrderList(); this.getOrderList();
@ -924,6 +800,13 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.head-menu {
height: 50rpx;
padding-left: 20rpx;
line-height: 50rpx;
font-weight: bold;
}
.my-order .header { .my-order .header {
height: 260rpx; height: 260rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -957,8 +840,6 @@
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.my-order .header .picTxt .pictrue { .my-order .header .picTxt .pictrue {
@ -1056,13 +937,6 @@
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
margin-top: 6rpx; margin-top: 6rpx;
.totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
padding-left: 28px;
}
} }
.my-order .list .item .item-info .text .name { .my-order .list .item .item-info .text .name {
@ -1106,8 +980,8 @@
font-size: 26rpx; font-size: 26rpx;
color: #282828; color: #282828;
text-align: right; text-align: right;
margin: 27rpx 0 0 -30rpx; margin: 27rpx 0 0 30rpx;
padding: -1px 20rpx 30rpx 0; padding: 0 30rpx 30rpx 0;
} }
.my-order .list .item .totalPrice .money { .my-order .list .item .totalPrice .money {
@ -1237,62 +1111,4 @@
font-size: 23rpx; 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> </style>

View File

@ -5,11 +5,13 @@
<view class='list'> <view class='list'>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>姓名</view> <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>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>联系电话</view> <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>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>所在地区</view> <view class='name'>所在地区</view>
@ -18,13 +20,14 @@
<text v-if="!addressInfo.length" style="color:#cdcdcd;">请选择地址</text> <text v-if="!addressInfo.length" style="color:#cdcdcd;">请选择地址</text>
<text v-else>{{addressText}}</text> <text v-else>{{addressText}}</text>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
</view> </view>
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>详细地址</view> <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"> <view class="location" @click="selfLocation">
<text class="iconfont icon-chakanditu"></text> <text class="iconfont icon-chakanditu"></text>
<br> <br>
@ -35,7 +38,8 @@
</view> </view>
<view class='default acea-row row-middle'> <view class='default acea-row row-middle'>
<checkbox-group @change='ChangeIsDefault'> <checkbox-group @change='ChangeIsDefault'>
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址</checkbox-group> <checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址
</checkbox-group>
</view> </view>
<button class='keepBnt' form-type="submit">立即保存</button> <button class='keepBnt' form-type="submit">立即保存</button>
@ -43,12 +47,13 @@
<view class="wechatAddress" v-if="!address_id" @click="getWxAddress">导入微信地址</view> <view class="wechatAddress" v-if="!address_id" @click="getWxAddress">导入微信地址</view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #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 --> <!-- #endif -->
</view> </view>
</form> </form>
<areaWindow ref="areaWindow" :display="display" :address="addressInfo" <areaWindow ref="areaWindow" :display="display" :address="addressInfo" @submit="OnChangeAddress"
@submit="OnChangeAddress" @changeClose="changeClose"></areaWindow> @changeClose="changeClose"></areaWindow>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
</view> </view>
</template> </template>
@ -63,11 +68,21 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { editAddress, getAddressDetail } from '@/api/user.js'; import {
import { getCityV2, getCityList } from '@/api/api.js'; editAddress,
import { mapGetters } from "vuex"; getAddressDetail
} from '@/api/user.js';
import {
getCityV2,
getCityList
} from '@/api/api.js';
import {
mapGetters
} from "vuex";
import areaWindow from '@/components/areaWindow'; import areaWindow from '@/components/areaWindow';
import { getGeocoder } from '@/api/store.js'; import {
getGeocoder
} from '@/api/store.js';
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
export default { export default {
components: { components: {
@ -92,14 +107,15 @@
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
cityId: 0, cityId: 0,
display: false, display: false,
addressInfo:[], addressInfo: [],
latitude: '', latitude: '',
longitude: '' longitude: ''
}; };
}, },
computed: {...mapGetters(['isLogin','viewColor']), computed: {
addressText(){ ...mapGetters(['isLogin', 'viewColor']),
return this.addressInfo.map(v=>v.name).join('/'); addressText() {
return this.addressInfo.map(v => v.name).join('/');
} }
}, },
onLoad(options) { onLoad(options) {
@ -119,7 +135,7 @@
} }
}, },
methods: { methods: {
OnChangeAddress(address){ OnChangeAddress(address) {
this.addressInfo = address; this.addressInfo = address;
}, },
// //
@ -129,7 +145,7 @@
this.district = res.data this.district = res.data
}) })
}, },
changeRegion(){ changeRegion() {
this.display = true; this.display = true;
}, },
// //
@ -170,7 +186,8 @@
success: function(res) { success: function(res) {
uni.chooseAddress({ uni.chooseAddress({
success: function(res) { 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.addressInfo = res.data;
}) })
that.userAddress.real_name = res.userName; that.userAddress.real_name = res.userName;
@ -183,9 +200,10 @@
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({ if (res.errMsg == 'chooseAddress:cancel') return that.$util
title: '取消选择' .Tips({
}); title: '取消选择'
});
}, },
}) })
}, },
@ -212,7 +230,7 @@
getAddress() { getAddress() {
let that = this; let that = this;
that.$wechat.openAddress().then(res => { 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.addressInfo = res.data;
}) })
that.userAddress.real_name = res.userName; that.userAddress.real_name = res.userName;
@ -222,14 +240,17 @@
// console.log(err); // console.log(err);
}); });
}, },
selfLocation() { selfLocation() {
console.log(66)
let self = this let self = this
uni.showLoading({ uni.showLoading({
title: '定位中', title: '定位中',
mask: true, mask: true,
}); });
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
timeout: '10',
success: (res) => { success: (res) => {
let latitude, longitude; let latitude, longitude;
latitude = res.latitude.toString(); latitude = res.latitude.toString();
@ -241,11 +262,15 @@
long: longitude long: longitude
}).then(res => { }).then(res => {
const data = res.data; 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.addressInfo = res.data;
self.$set(self.userAddress, 'detail', data.formatted_addresses.recommend); self.$set(self.userAddress, 'detail', data.formatted_addresses
.recommend);
uni.hideLoading(); uni.hideLoading();
}).catch(e=>{ }).catch(e => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '定位失败,请手动输入地址', title: '定位失败,请手动输入地址',
@ -253,7 +278,7 @@
duration: 1000 duration: 1000
}); });
}) })
}).catch(e=>{ }).catch(e => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '定位失败,请手动输入地址', title: '定位失败,请手动输入地址',
@ -323,8 +348,10 @@
that.couponId = ''; that.couponId = '';
uni.$emit('updataAddress') uni.$emit('updataAddress')
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data url: '/pages/users/order_confirm/index?cartId=' + cartId +
.address_id) + '&pinkId=' + pinkId + '&couponId=' + couponId '&addressId=' + (that.id ? that.id : res.data
.address_id) + '&pinkId=' + pinkId + '&couponId=' +
couponId
}); });
} else { } else {
// #ifdef H5 // #ifdef H5
@ -353,74 +380,92 @@
<style scoped lang="scss"> <style scoped lang="scss">
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked, /deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked { /deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 1px solid var(--view-theme)!important; border: 1px solid var(--view-theme) !important;
background-color: var(--view-theme)!important; background-color: var(--view-theme) !important;
color: #fff!important; color: #fff !important;
} }
.addAddress .list { .addAddress .list {
background-color: #fff; background-color: #fff;
} }
.addAddress .list .item { .addAddress .list .item {
padding: 30rpx; padding: 30rpx;
border-top: 1px solid #eee; border-top: 1px solid #eee;
position: relative; position: relative;
} }
.addAddress .list .item .location{
.addAddress .list .item .location {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
top: 15rpx; top: 15rpx;
text-align: center; text-align: center;
font-size: 20rpx; font-size: 20rpx;
.iconfont{
.iconfont {
color: var(--view-theme); color: var(--view-theme);
} }
} }
.addAddress .list .item .name { .addAddress .list .item .name {
width: 195rpx; width: 195rpx;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
.addAddress .list .item .address { .addAddress .list .item .address {
flex: 1; flex: 1;
margin-left: 20rpx; margin-left: 20rpx;
} }
.addAddress .list .item input,.region .region_count {
.addAddress .list .item input,
.region .region_count {
width: 475rpx; width: 475rpx;
font-size: 30rpx; font-size: 30rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.region .region_count{
.region .region_count {
height: 42rpx; height: 42rpx;
line-height: 42rpx; line-height: 42rpx;
.icon-xiangyou{
.icon-xiangyou {
float: right; float: right;
} }
} }
.addAddress .list .location-input{
.addAddress .list .location-input {
padding-right: 70rpx; padding-right: 70rpx;
} }
.addAddress .list .item .placeholder { .addAddress .list .item .placeholder {
color: #ccc; color: #ccc;
} }
.addAddress .list .item picker { .addAddress .list .item picker {
width: 475rpx; width: 475rpx;
} }
.addAddress .list .item picker .picker { .addAddress .list .item picker .picker {
width: 410rpx; width: 410rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.addAddress .list .item picker .iconfont { .addAddress .list .item picker .iconfont {
font-size: 43rpx; font-size: 43rpx;
} }
.addAddress .default { .addAddress .default {
padding: 0 30rpx; padding: 0 30rpx;
height: 90rpx; height: 90rpx;
background-color: #fff; background-color: #fff;
margin-top: 23rpx; margin-top: 23rpx;
} }
.addAddress .default checkbox { .addAddress .default checkbox {
margin-right: 15rpx; margin-right: 15rpx;
} }
.addAddress .keepBnt { .addAddress .keepBnt {
width: 690rpx; width: 690rpx;
height: 86rpx; height: 86rpx;
@ -432,6 +477,7 @@
color: #fff; color: #fff;
background-color: var(--view-theme); background-color: var(--view-theme);
} }
.addAddress .wechatAddress { .addAddress .wechatAddress {
width: 690rpx; width: 690rpx;
height: 86rpx; height: 86rpx;