详情的地区选择

main
fanfan 1 year ago
parent 8d530aecb0
commit bb3c0ab9e9
  1. 4
      api/goods/index.js
  2. 2
      manifest.json
  3. 7
      pages.json
  4. 32
      pages/cart/index.vue
  5. 95
      pages/goods/detail.vue
  6. 85
      pages/goods/list.vue
  7. 97
      pages/index/index.vue
  8. 2
      pages/news1/wallet.vue
  9. 3
      pages/serve/install.vue
  10. 1122
      utils/qqmap-wx-jssdk.js
  11. 1
      utils/qqmap-wx-jssdk.min.js

@ -89,4 +89,8 @@ export const poster = param => {
// 店长设置秒杀价 // 店长设置秒杀价
export const editGoodsSeckillPrice = param => { export const editGoodsSeckillPrice = param => {
return request.post('StoreKeeper/editGoodsSeckillPrice', param) return request.post('StoreKeeper/editGoodsSeckillPrice', param)
}
// 是否有货
export const getGoodsStock = param => {
return request.get('goods/getGoodsStock', param)
} }

@ -141,7 +141,7 @@
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {
"qqmap" : { "qqmap" : {
"key" : "ZWEBZ-R7N3U-BJSVH-4TCR3-66MDQ-S3FDJ" "key" : "ZDBBZ-QQX66-YVYSB-M56JB-FGSS5-EIBI4"
} }
} }
}, },

@ -751,13 +751,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
// "navigationBarTitleText": "商品详情页" // "navigationBarTitleText": "商品详情页"
} }
},
{
"path": "city",
"style": {
"navigationBarTitleText": "城市列表",
"enablePullDownRefresh": true
}
} }
] ]
}, },

@ -99,20 +99,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}
@ -160,20 +148,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}

@ -102,29 +102,17 @@
<image src="../../static/test/address.png" <image src="../../static/test/address.png"
style="width: 46rpx;height: 46rpx;margin-right: 7rpx;"> style="width: 46rpx;height: 46rpx;margin-right: 7rpx;">
</image> </image>
<text style="margin-right: 10rpx;">南京有货</text> <text style="margin-right: 10rpx;">{{addressResult.city}}{{stockValue}}</text>
<u-icon name="arrow-right" color="#B7B7B7" size="22"></u-icon> <u-icon name="arrow-right" color="#B7B7B7" size="22"></u-icon>
</picker> </picker>
</view> </view>
<view v-if="goods.goods_no" class="operaImg" @click="copyNum(goods.unicode)"> <view v-if="goods.unicode" class="operaImg" @click="copyNum(goods.unicode)">
<view class="left_1" v-if="goods.goods_source==0"> <view class="left_1">
JD {{goods.goods_source}}
</view>
<view class="left_1" v-if="goods.goods_source==1">
SN
</view>
<view class="left_1" v-if="goods.goods_source==2">
GC
</view>
<view class="left_1" v-if="goods.goods_source==3">
CC
</view>
<view class="left_1" v-if="goods.goods_source==4">
ZC
</view> </view>
<text>{{goods.unicode}}</text> <text>{{goods.unicode}}</text>
<image :src="$picUrl+'/static/detail/copy.png'" <image :src="$picUrl+'/static/detail/copy.png'"
style="width: 27rpx;height: 27rpx;margin-left: 5rpx;"></image> style="width: 27rpx;height: 27rpx;margin-left: 8rpx;"></image>
</view> </view>
</view> </view>
</view> </view>
@ -158,7 +146,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="chosed"> <!-- <view class="chosed">
<view class="serve"> <view class="serve">
<view class="serveInfo"> <view class="serveInfo">
商家 商家
@ -175,7 +163,7 @@
</view> </view>
<u-icon name="arrow-right" style="float: right;" color="#B7B7B7"></u-icon> <u-icon name="arrow-right" style="float: right;" color="#B7B7B7"></u-icon>
</view> </view>
</view> </view> -->
<view class="chosed"> <view class="chosed">
<view class="title">发货</view> <view class="title">发货</view>
<view class="info">预计 <view class="info">预计
@ -516,13 +504,21 @@
}], }],
selectSku: '', selectSku: '',
selectShop: 1, selectShop: 1,
multiIndex: [0, 0], multiIndex: [0, 0, 0],
multiArray: [], multiArray: [],
multiData: [] multiData: [],
stockValue: '南京市',
addressResult: {
province: '江苏省',
city: '南京市',
district: '玄武区'
}
} }
}, },
onLoad(options) { onLoad(options) {
const that = this; const that = this;
let result = uni.getStorageSync("addressResult")
this.addressResult = result.address_component || ''
this.isPre = options.isPre ? options.isPre : null this.isPre = options.isPre ? options.isPre : null
// query // query
// this.onRecordQuery(options) // this.onRecordQuery(options)
@ -537,9 +533,9 @@
this.getServeList() this.getServeList()
this.getGoodsDetail() this.getGoodsDetail()
this.cityInfo = uni.getStorageSync("cityInfo"); this.cityInfo = uni.getStorageSync("cityInfo");
this.getGoodsStockInfor()
this.getCartTotal() this.getCartTotal()
this.getProvinceAll() this.getProvinceAll()
this.getAdressLocation()
uni.$on("onenPrice", function(selectShop) { uni.$on("onenPrice", function(selectShop) {
that.openPirce(); that.openPirce();
that.isTodo = false; that.isTodo = false;
@ -573,19 +569,21 @@
} }
}, },
methods: { methods: {
getAdressLocation() { async getGoodsStockInfor() {
const that = this let params = {
uni.getLocation({ // goods_id: this.goodsId,
type: 'gcj02', province: this.addressResult ? this.addressResult.province : '江苏省',
success(res) { city: this.addressResult ? this.addressResult.city : '南京市',
let longitude = res.longitude district: this.addressResult ? this.addressResult.district : '玄武区'
let latitude = res.latitude }
console.log(res, 'AAAAAAAAAAAAAA') let {
}, status,
fail(err) { message,
console.log(err, '获取经纬度失败') data
}, } = await GoodsApi.getGoodsStock(params);
}) if (status == 200) {
this.stockValue = data.stock
}
}, },
async getProvinceAll() { async getProvinceAll() {
let { let {
@ -599,26 +597,20 @@
this.multiArray = [ this.multiArray = [
this.multiData, this.multiData,
this.multiData[0].children, this.multiData[0].children,
this.multiData[0].children[0].children
] ]
} }
}, },
// //
multiChange: function(e) { multiChange: function(e) {
this.multiIndex = e.detail.value; this.multiIndex = e.detail.value;
let a_name = this.multiArray[0][e.detail.value[0]].name; let province = this.multiArray[0][e.detail.value[0]].name;
let a_id = this.multiArray[0][e.detail.value[0]].id; let city = this.multiArray[1][e.detail.value[1]].name;
let b_name = this.multiArray[1][e.detail.value[1]].name; let district = this.multiArray[2][e.detail.value[2]].name;
let b_id = this.multiArray[1][e.detail.value[1]].id; this.addressResult.province = province;
// this.cityInfo.province = a_name; this.addressResult.city = city
// this.cityInfo.city = b_name; this.addressResult.district = district
let region = [{ this.getGoodsStockInfor()
value: a_id,
label: a_name
}, {
value: b_id,
label: b_name
}];
console.log(region)
}, },
// //
@ -630,6 +622,7 @@
this.multiArray = [ this.multiArray = [
_this.multiData, _this.multiData,
_this.multiData[_this.multiIndex[0]].children, _this.multiData[_this.multiIndex[0]].children,
_this.multiData[_this.multiIndex[0]].children[_this.multiIndex[1]].children
] ]
}, },
// query // query
@ -2211,13 +2204,13 @@
.left_1 { .left_1 {
height: 100%; height: 100%;
width: 50rpx; margin-right: 8rpx;
line-height: 36.5rpx; line-height: 36.5rpx;
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 30rpx; font-size: 30rpx;
color: #F21A1C; color: #F21A1C;
text-align: center; text-align: center;
margin-right: 5rpx; margin-right: 10rpx;
} }
</style> </style>

@ -51,8 +51,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sort-item" :class="{ active: sortType === 'city' }" @click="handleSortType('city')"> <view class="sort-item" :class="{ active: sortType === 'city' }" @click="handleSortType('city')">
<text>同城达</text> <picker mode="selector" @change="multiChange" value="{{multiIndex}}" :range="multiArray"
range-key="name">
<text>类型</text>
</picker>
</view> </view>
<!-- <view class="show-view btnOpera" @click="handleShowView"> <!-- <view class="show-view btnOpera" @click="handleShowView">
<text class="iconfont icon-view-tile" v-if="showView"></text> <text class="iconfont icon-view-tile" v-if="showView"></text>
@ -133,20 +137,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}
@ -199,20 +191,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}
@ -290,7 +270,24 @@
use: false, use: false,
} }
}, },
tabbar: [] tabbar: [],
multiArray: [{
value: 'JD',
name: '京东'
}, {
value: 'SN',
name: '苏宁'
}, {
value: 'GC',
name: '工厂'
}, {
value: 'CC',
name: '仓储 '
}, {
value: 'ZC',
name: '自采'
}],
multiIndex: -1,
} }
}, },
@ -312,6 +309,14 @@
}, },
methods: { methods: {
multiChange(e) {
this.multiIndex = Number(e.detail.value)
//
this.$refs.uWaterfall1.clear();
this.list.data = []
this.list = getEmptyPaginateObj()
this.mescroll.resetUpScroll()
},
getGoodsTypeList(category_id) { getGoodsTypeList(category_id) {
const that = this; const that = this;
that.goodsType = [] that.goodsType = []
@ -402,16 +407,16 @@
keywords.push(this.keyName2) keywords.push(this.keyName2)
} }
const param = { const param = {
sortType: app.sortType, sortType: app.sortType != 'city' ? app.sortType : '',
sortPrice: Number(app.sortPrice), sortPrice: Number(app.sortPrice),
categoryId: (app.options.categoryId || app.options.categoryId != undefined) ? app.options categoryId: (app.options.categoryId || app.options.categoryId != undefined) ? app.options
.categoryId : 0, .categoryId : 0,
// goodsName: app.options.search || '', // goodsName: app.options.search || '',
page: pageNo, page: pageNo,
keywords: keywords.length > 0 ? keywords.join(',') : '', keywords: keywords.length > 0 ? keywords.join(',') : '',
keyword: app.options.search || '' keyword: app.options.search || '',
goods_source: this.multiIndex > -1 ? this.multiArray[this.multiIndex].value : ''
} }
console.log(param)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
GoodsApi.list(param) GoodsApi.list(param)
.then(result => { .then(result => {
@ -429,14 +434,16 @@
// //
handleSortType(newSortType) { handleSortType(newSortType) {
const app = this const app = this
const newSortPrice = newSortType === 'price' ? !app.sortPrice : true
app.sortType = newSortType app.sortType = newSortType
app.sortPrice = newSortPrice
app.$refs.uWaterfall1.clear();
app.list.data = []
// //
app.list = getEmptyPaginateObj() if (newSortType != 'city') {
app.mescroll.resetUpScroll() const newSortPrice = newSortType === 'price' ? !app.sortPrice : true
app.sortPrice = newSortPrice
app.$refs.uWaterfall1.clear();
app.list.data = []
app.list = getEmptyPaginateObj()
app.mescroll.resetUpScroll()
}
}, },
// //

@ -268,20 +268,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}
@ -329,20 +317,8 @@
</view> </view>
<view class="goodsSend"> <view class="goodsSend">
<view class="sendLeft"> <view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0"> <view class="left_1">
JD {{item.goods_source}}
</view>
<view class="left_1" v-if="item.goods_source==1">
SN
</view>
<view class="left_1" v-if="item.goods_source==2">
GC
</view>
<view class="left_1" v-if="item.goods_source==3">
CC
</view>
<view class="left_1" v-if="item.goods_source==4">
ZC
</view> </view>
<view class="left_2"> <view class="left_2">
{{Number(item.discount)}} {{Number(item.discount)}}
@ -568,6 +544,7 @@
import * as Api from '@/api/goods' import * as Api from '@/api/goods'
import * as activity from '@/api/activity' import * as activity from '@/api/activity'
import * as newFunApi from '@/api/newFun' import * as newFunApi from '@/api/newFun'
import QQMapWX from '@/utils/qqmap-wx-jssdk'
export default { export default {
data() { data() {
return { return {
@ -1055,6 +1032,69 @@
scrollTop: 0 scrollTop: 0
}) })
}, },
//
getAuthorize() {
const _this = this
uni.authorize({
scope: 'scope.userLocation', //
success(res) {
_this.getAdressLocation()
},
//
fail(err) {
uni.showModal({
title: '温馨提示',
content: '无法获取当前位置,请手动开启授权',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定')
uni.openSetting({
success(res) {
if (res.authSetting['scope.userLocation']) {
console.log('打开授权设置定位')
_this.getAdressLocation()
}
},
})
} else if (res.cancel) {
console.log('用户点击取消')
}
},
})
},
})
},
getAdressLocation() {
var that = this;
const tMap = new QQMapWX({
key: "ZDBBZ-QQX66-YVYSB-M56JB-FGSS5-EIBI4", //
});
uni.getLocation({
type: "gcj02",
geocode: true,
success: (res) => {
that.longitude = res.longitude;
that.latitude = res.latitude;
tMap.reverseGeocoder({
location: {
latitude: that.latitude,
longitude: that.longitude,
},
success: function(res) {
uni.setStorageSync("addressResult", res.result);
console.log("当前地址:", res.result);
},
fail: function(res) {
console.log("定位失败", res);
},
});
},
fail: () => {
console.log("获取经纬度失败");
},
});
},
}, },
onLoad() { onLoad() {
this.getTypeList() this.getTypeList()
@ -1066,6 +1106,7 @@
this.queryBannerList(); this.queryBannerList();
this.getStore(); this.getStore();
this.queryWxAppSetting(); this.queryWxAppSetting();
this.getAuthorize()
}, },
onShow() { onShow() {
this.isLogin = uni.getStorageSync("AccessToken") ? true : false this.isLogin = uni.getStorageSync("AccessToken") ? true : false

@ -29,7 +29,7 @@
<u-icon name="arrow-right" color="#909090" size="22"></u-icon> <u-icon name="arrow-right" color="#909090" size="22"></u-icon>
</view> </view>
<view class="num"> <view class="num">
¥ {{infor.pay_money?Number(infor.pay_money):infor.pay_money}} ¥ {{infor.balance?Number(infor.balance):infor.balance}}
</view> </view>
</view> </view>
<view class="handleBtn" @click="cashOut"> <view class="handleBtn" @click="cashOut">

@ -49,9 +49,10 @@
}, },
methods: { methods: {
onLookCord(url) { onLookCord(url) {
console.log(url)
uni.previewImage({ uni.previewImage({
urls: [url], //httpurl urls: [url], //httpurl
current: '', // http current: url, // http
success: function(res) {}, success: function(res) {},
fail: function(res) {}, fail: function(res) {},
complete: function(res) {}, complete: function(res) {},

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save