Commit c6dc33a2 authored by 肖健's avatar 肖健

省市区改为接口

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