详情的地区选择

main
fanfan 9 months 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. 77
      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

@ -90,3 +90,7 @@ export const poster = param => {
export const editGoodsSeckillPrice = param => {
return request.post('StoreKeeper/editGoodsSeckillPrice', param)
}
// 是否有货
export const getGoodsStock = param => {
return request.get('goods/getGoodsStock', param)
}

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

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

@ -99,20 +99,8 @@
</view>
<view class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}
@ -160,20 +148,8 @@
</view>
<view class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}

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

@ -51,8 +51,12 @@
</view>
</view>
</view>
<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 class="show-view btnOpera" @click="handleShowView">
<text class="iconfont icon-view-tile" v-if="showView"></text>
@ -133,20 +137,8 @@
</view>
<view class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}
@ -199,20 +191,8 @@
</view>
<view class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}
@ -290,7 +270,24 @@
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: {
multiChange(e) {
this.multiIndex = Number(e.detail.value)
//
this.$refs.uWaterfall1.clear();
this.list.data = []
this.list = getEmptyPaginateObj()
this.mescroll.resetUpScroll()
},
getGoodsTypeList(category_id) {
const that = this;
that.goodsType = []
@ -402,16 +407,16 @@
keywords.push(this.keyName2)
}
const param = {
sortType: app.sortType,
sortType: app.sortType != 'city' ? app.sortType : '',
sortPrice: Number(app.sortPrice),
categoryId: (app.options.categoryId || app.options.categoryId != undefined) ? app.options
.categoryId : 0,
// goodsName: app.options.search || '',
page: pageNo,
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) => {
GoodsApi.list(param)
.then(result => {
@ -429,14 +434,16 @@
//
handleSortType(newSortType) {
const app = this
const newSortPrice = newSortType === 'price' ? !app.sortPrice : true
app.sortType = newSortType
//
if (newSortType != 'city') {
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 class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}
@ -329,20 +317,8 @@
</view>
<view class="goodsSend">
<view class="sendLeft">
<view class="left_1" v-if="item.goods_source==0">
JD
</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 class="left_1">
{{item.goods_source}}
</view>
<view class="left_2">
{{Number(item.discount)}}
@ -568,6 +544,7 @@
import * as Api from '@/api/goods'
import * as activity from '@/api/activity'
import * as newFunApi from '@/api/newFun'
import QQMapWX from '@/utils/qqmap-wx-jssdk'
export default {
data() {
return {
@ -1055,6 +1032,69 @@
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() {
this.getTypeList()
@ -1066,6 +1106,7 @@
this.queryBannerList();
this.getStore();
this.queryWxAppSetting();
this.getAuthorize()
},
onShow() {
this.isLogin = uni.getStorageSync("AccessToken") ? true : false

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

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