Commit c6dc33a2 authored by 肖健's avatar 肖健

省市区改为接口

parent f0f897fb
......@@ -57,14 +57,7 @@
{
"path": "pages/login/wv-common/wv-common",
"style": {}
},
{
"path": "pages/mrAct/index",
"style": {
"navigationBarTitleText": "京东挪车码领取",
"enablePullDownRefresh": false
}
}
}
],
"subPackages": [
{
......@@ -87,7 +80,14 @@
"style": {
"navigationBarTitleText": "领取优惠券"
}
}
},
{
"path": "pages/mrAct/index",
"style": {
"navigationBarTitleText": "京东挪车码领取",
"enablePullDownRefresh": false
}
}
]
},
{
......
......@@ -58,14 +58,14 @@
</u-form-item>
</u--form>
<view style="margin-top: 38rpx;display: flex; justify-content: center;">
<view v-if="!disabledSubmit" style="background: url('../../static/act/submit_btn.png') no-repeat; background-size: 100% 100%; width: 481rpx; height: 120rpx;"
<view v-if="!disabledSubmit" style="background: url('../../../static/act/submit_btn.png') no-repeat; background-size: 100% 100%; width: 481rpx; height: 120rpx;"
@click="submitAct">
<view style="display: flex;justify-content: center;align-items: center;height: 120rpx; width: 481rpx;position: relative; top:-6rpx;">
<text style="font-size: 38rpx;color:#8E3B09;font-weight: bold;line-height: 42rpx;">立即领取</text>
<image src="@/static/act/arrow-right.png" style="width:18rpx;height:28rpx; margin-left: 20rpx;"></image>
</view>
</view>
<view v-if="disabledSubmit" style="background: url('../../static/act/submit_btn.dis.png') no-repeat; background-size: 100% 100%; width: 481rpx; height: 120rpx;"
<view v-if="disabledSubmit" style="background: url('../../../static/act/submit_btn.dis.png') no-repeat; background-size: 100% 100%; width: 481rpx; height: 120rpx;"
@click="submitAct">
<view style="display: flex;justify-content: center;align-items: center;height: 120rpx; width: 481rpx;position: relative; top:-6rpx;">
<text style="font-size: 38rpx;color:#8E3B09; opacity: 0.3; font-weight: bold;line-height: 42rpx;">立即领取</text>
......@@ -150,15 +150,15 @@
</u-popup>
<!-- 领取成功 -->
<u-popup :show="receiveSuccessShow" mode="center" bgColor="transparent" @close="receiveSuccessShow = false">
<view style="width: 522rpx; height: 396rpx;background: url('../../static/act/receive-success.png') no-repeat; background-size: 100% 100%;">
<view style="margin: 18rpx auto 13rpx auto ;width: 72rpx; height: 72rpx;background: url('../../static/act/ok.png') no-repeat; background-size: 100% 100%;"></view>
<view style="width: 522rpx; height: 396rpx;background: url('../../../static/act/receive-success.png') no-repeat; background-size: 100% 100%;">
<view style="margin: 18rpx auto 13rpx auto ;width: 72rpx; height: 72rpx;background: url('../../../static/act/ok.png') no-repeat; background-size: 100% 100%;"></view>
<view style="text-align: center;">
<text style="color:#E62929;font-size: 36rpx;line-height: 36rpx;font-weight: bold;">领取成功</text>
</view>
<view style="margin: 12rpx auto 0 auto;width:380rpx;text-align: center;">
<text style="font-weight: 400;color: #620F0F;font-size: 24rpx;">您已经免费领取京东汽车挪车牌,正在为您派送中,请耐心等待。</text>
</view>
<view @click="goToIndex" style="margin: 12rpx auto 0 auto;width: 398rpx; height: 108rpx;background: url('../../static/act/back-index.png') no-repeat; background-size: 100% 100%;">
<view @click="goToIndex" style="margin: 12rpx auto 0 auto;width: 398rpx; height: 108rpx;background: url('../../../static/act/back-index.png') no-repeat; background-size: 100% 100%;">
<view style="display: flex;justify-content: center;align-items: center;height: 108rpx;position: relative; top:-6rpx">
<text style="font-size: 32rpx;color:#8E3B09;text-shadow: 0px 4px 8px rgba(146,66,25,0.27); font-weight: bold;line-height: 36rpx;">返回首页</text>
</view>
......@@ -167,7 +167,7 @@
</u-popup>
<!-- 已经领取 -->
<u-popup :show="receivedFailShow" mode="center" bgColor="transparent" @close="receivedFailShow = false">
<view style="width: 522rpx; height: 396rpx;background: url('../../static/act/receive-success.png') no-repeat; background-size: 100% 100%;position: relative;">
<view style="width: 522rpx; height: 396rpx;background: url('../../../static/act/receive-success.png') no-repeat; background-size: 100% 100%;position: relative;">
<view style="text-align: center;margin-top: 30rpx;">
<text style="color:#620F0F;font-size: 36rpx;line-height: 36rpx;font-weight: 500;">温馨提示</text>
</view>
......@@ -175,7 +175,7 @@
<text style="font-weight: 400;color: #620F0F;font-size: 24rpx;">{{ alreadyMsg}}</text>
</view>
<view style="position: absolute; bottom: 52rpx; width: 100%;">
<view @click="closeReceivedFail" style="margin:0 auto;width: 398rpx; height: 108rpx;background: url('../../static/act/back-index.png') no-repeat; background-size: 100% 100%;">
<view @click="closeReceivedFail" style="margin:0 auto;width: 398rpx; height: 108rpx;background: url('../../../static/act/back-index.png') no-repeat; background-size: 100% 100%;">
<view style="display: flex;justify-content: center;align-items: center;height: 108rpx;position: relative; top:-6rpx">
<text style="font-size: 32rpx;color:#8E3B09;text-shadow: 0px 4px 8px rgba(146,66,25,0.27); font-weight: bold;line-height: 36rpx;">知道了</text>
</view>
......@@ -468,7 +468,7 @@ export default {
let token = uni.getStorageSync('userToken')
if(!token) {
uni.setStorageSync('routerLogin', '/pages/mrAct/index')
uni.setStorageSync('routerLogin', '/pagesA/pages/mrAct/index')
//跳转到登录页
let returnPage = '/pages/main';
let pageType = "reLaunch"
......
......@@ -9,7 +9,7 @@
</view>
</template>
<script>
import area from "../../province-city-county.json"
// import area from "../../province-city-county.json"
export default {
props: {
show: {
......@@ -88,44 +88,54 @@
}
},
formatData() {
this.province = area.map(t => {
return {
name: t.name,
areaId: t.areaId
}
})
this.city = area.map(t => t.children.map(v => {
return {
name: v.name,
areaId: v.areaId
}
}))
this.area = area.map(t => t.children.map(v => v.children.map(i => {
return {
name: i.name,
areaId: i.areaId
}
})))
//默认显示数据
this.columns = [
this.province.map(res => res.name),
this.city[0].map(res => res.name),
this.area[0][0].map(res => res.name)
]
//数据回显
if (this.addressData?.province && this.addressData?.city && this.addressData?.area) {
//省索引
let pIdx = this.province.findIndex(v => v.name == this.addressData.province);
//根据省索引设置默认市数据
this.columns[1] = this.city[pIdx].map(res => res.name)
//市索引
let cIdx = this.city[pIdx].findIndex(v => v.name == this.addressData.city);
//根据市索引设置默认区数据
this.columns[2] = this.area[pIdx][cIdx].map(res => res.name)
//区索引
let aIdx = this.area[pIdx][cIdx].findIndex(v => v.name == this.addressData.area);
this.indexs = [pIdx, cIdx, aIdx];
}
let areaArr = []
this.$http.request({
url:'http://jdnc-oss.uzosp.com/2023/01/11/6348409c2d314217be066020c9556c51.json',
method:'get',
data:{ },
load:false,
isFactory:false,
}).then(res => {
areaArr = res.data
this.province = areaArr.map(t => {
return {
name: t.name,
areaId: t.areaId
}
})
this.city = areaArr.map(t => t.children.map(v => {
return {
name: v.name,
areaId: v.areaId
}
}))
this.area = areaArr.map(t => t.children.map(v => v.children.map(i => {
return {
name: i.name,
areaId: i.areaId
}
})))
//默认显示数据
this.columns = [
this.province.map(res => res.name),
this.city[0].map(res => res.name),
this.area[0][0].map(res => res.name)
]
//数据回显
if (this.addressData?.province && this.addressData?.city && this.addressData?.area) {
//省索引
let pIdx = this.province.findIndex(v => v.name == this.addressData.province);
//根据省索引设置默认市数据
this.columns[1] = this.city[pIdx].map(res => res.name)
//市索引
let cIdx = this.city[pIdx].findIndex(v => v.name == this.addressData.city);
//根据市索引设置默认区数据
this.columns[2] = this.area[pIdx][cIdx].map(res => res.name)
//区索引
let aIdx = this.area[pIdx][cIdx].findIndex(v => v.name == this.addressData.area);
this.indexs = [pIdx, cIdx, aIdx];
}
})
},
confirm(e) {
this.$emit("confirm", e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment