首次提交
1275
running/Cityservice/Cityservice.vue
Normal file
1570
running/Helppay/Helppay.vue
Normal file
1565
running/Helpsend/Helpsend.vue
Normal file
447
running/closeaddress/closeaddress.vue
Normal file
@@ -0,0 +1,447 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-navbar :is-back="true">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view style="width: 100%;text-align: center;letter-spacing: 2rpx;font-weight: bold;font-size: 30rpx;">
|
||||
<view v-if="indentType == 1||indentType == 2||indentType == 3">填写收货地址</view>
|
||||
<view v-if="indentType == 4">填写服务地址</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="slot-wrap">
|
||||
<view v-if="indentType == 1||indentType == 2||indentType == 3">填写收货地址</view>
|
||||
<view v-if="indentType == 4">填写服务地址</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</u-navbar>
|
||||
<view class="content">
|
||||
<!-- 正文内容 -->
|
||||
<view class="takeaddress">
|
||||
<view class="part1">
|
||||
<view class="name">
|
||||
<u-field v-model="name" placeholder="联系人姓名" type="text" icon="account-fill"
|
||||
label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="mobile">
|
||||
<u-field :maxlength="11" v-model="mobile" type="number" placeholder="联系电话" icon="phone-fill"
|
||||
label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="address" @click="bindmap">
|
||||
<u-field v-model="cityaddress" placeholder="选择地址" :disabled="true" icon="map-fill"
|
||||
label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="detailaddress">
|
||||
<u-field v-model="detailaddress" placeholder="详细地址" icon="map-fill" label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="btn" @click="bindhelp">确定</view>
|
||||
</view>
|
||||
<view class="part2">
|
||||
<view v-if="oldlist.length>0">
|
||||
<view class="address1">常用地址</view>
|
||||
<view class="address_box" v-for="(item,index) in oldlist" :key="index" @click="goBack(item.addressId)">
|
||||
<view class="address_left">
|
||||
<u-icon name="map-fill"></u-icon>
|
||||
</view>
|
||||
<view class="address_right">
|
||||
<view class="add">
|
||||
{{item.address}}{{item.addressDetail}}
|
||||
</view>
|
||||
<view class="num">
|
||||
<view class="name">{{item.userName}}</view>
|
||||
<view class="number">{{item.userPhone}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap.stop='deleteAddressList(item)' class="dete">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view v-else>
|
||||
<view style="width: 50%;margin: 0 auto;">
|
||||
<image src="../../static/image/emety.png" style="width: 100%;height: 390rpx;"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mobile: '',
|
||||
name: '',
|
||||
cityaddress: '',
|
||||
detailaddress: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
oldlist: [],
|
||||
indentType: 1,
|
||||
current: 0,
|
||||
addressType: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
if (e.addressType) {
|
||||
this.addressType = e.addressType
|
||||
}
|
||||
|
||||
this.indentType = e.index
|
||||
this.current = e.current
|
||||
this.oldAddress()
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
bindhelp() {
|
||||
let that = this
|
||||
let token = that.$queue.getData("token")
|
||||
if (!token) {
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.mobile.length != 11) {
|
||||
uni.showToast({
|
||||
title: '请正确输入联系电话',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!/^1[3456789]\d{9}$/.test(that.mobile)) {
|
||||
uni.showToast({
|
||||
title: '请正确输入联系电话',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.name == '') {
|
||||
uni.showToast({
|
||||
title: '请输入联系人姓名',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.cityaddress == '') {
|
||||
uni.showToast({
|
||||
title: '请输入收货地址',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.detailaddress == '') {
|
||||
uni.showToast({
|
||||
title: '请输入详细地址',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let userId = that.$queue.getData('userId');
|
||||
let data = {
|
||||
type: that.type,
|
||||
userPhone: that.mobile,
|
||||
userName: that.name,
|
||||
address: that.cityaddress, ///注释
|
||||
addressDetail: that.detailaddress,
|
||||
addressLatitude: that.latitude,
|
||||
addressLongitude: that.longitude,
|
||||
userId: userId
|
||||
}
|
||||
that.$Request.postJson('/app/indent/addUserAddress', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$queue.showToast("地址保存成功!");
|
||||
// uni.navigateBack();
|
||||
setTimeout(function(){
|
||||
that.goBack(res.data)
|
||||
},500)
|
||||
} else {
|
||||
that.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击地址返回上一页
|
||||
goBack(e) {
|
||||
console.log(e)
|
||||
uni.setStorageSync('addressId',e)
|
||||
uni.setStorageSync('addressType',this.addressType)
|
||||
setTimeout(function(){
|
||||
uni.navigateBack()
|
||||
},10)
|
||||
},
|
||||
bindback(e) {
|
||||
let address = uni.getStorageSync('closeAddress')
|
||||
console.log(e)
|
||||
let add = {
|
||||
addressId: e.addressId,
|
||||
deliveryUserPhone: e.userPhone,
|
||||
deliveryUserName: e.userName,
|
||||
deliveryAddress: e.address, ///注释
|
||||
deilveryAddressDetail: e.addressDetail,
|
||||
userId: e.userId,
|
||||
deliveryAddressLatitude: e.addressLatitude,
|
||||
deliveryAddressLongitude: e.addressLongitude
|
||||
}
|
||||
if (this.indentType == 1) {
|
||||
address.data2 = add
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helpsend/Helpsend?index=' + this.indentType
|
||||
})
|
||||
} else if (this.indentType == 2) {
|
||||
address.data2 = add
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helpsend/Helpsend?index=' + this.indentType
|
||||
})
|
||||
} else if (this.indentType == 3 && this.current == 0) {
|
||||
address.data3 = add
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helppay/Helppay?index=' + this.indentType + '¤t=' + this.current
|
||||
})
|
||||
} else if (this.indentType == 3 && this.current == 1) {
|
||||
address.data4 = add
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helppay/Helppay?index=' + this.indentType + '¤t=' + this.current
|
||||
})
|
||||
} else if (this.indentType == 4) {
|
||||
address.citydata = add
|
||||
uni.navigateTo({
|
||||
url: '/pages/Cityservice/Cityservice?index=' + this.indentType
|
||||
})
|
||||
|
||||
}
|
||||
uni.setStorageSync("closeAddress", address)
|
||||
// uni.navigateBack()
|
||||
// uni.navigateBack()
|
||||
// if (this.indentType == 1) {
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/Helpsend/Helpsend?index=' + this.indentType
|
||||
// })
|
||||
// }
|
||||
},
|
||||
bindmap() {
|
||||
var that = this
|
||||
// if (that.ciaddress == '') {
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
// console.log('位置名称:' + res.name);
|
||||
// console.log('详细地址:' + res.address);
|
||||
// console.log('纬度:' + res.latitude);
|
||||
// console.log('经度:' + res.longitude);
|
||||
that.detailaddress = res.name
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
that.shengcheng(res.longitude, res.latitude)
|
||||
}
|
||||
});
|
||||
// }
|
||||
},
|
||||
shengcheng(longitude, latitude) {
|
||||
this.$Request.getT('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
|
||||
// console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.cityaddress = res.data.province + res.data.city + res.data.district
|
||||
// console.log(this.address)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
oldAddress() {
|
||||
this.$Request.getT('/app/indent/findUserAddress').then(res => {
|
||||
// console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.oldlist = res.data
|
||||
console.log(this.oldlist)
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteAddressList(e) {
|
||||
console.log(e)
|
||||
let data = {
|
||||
userName: e.userName,
|
||||
userPhone: e.userPhone,
|
||||
address: e.address,
|
||||
addressDetail: e.addressDetail,
|
||||
addressLatitude: e.addressLatitude,
|
||||
addressLongitude: e.addressLongitude,
|
||||
userId: e.userId,
|
||||
addressId: e.addressId,
|
||||
addressDefault: e.addressDefault
|
||||
}
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '您确定要删除此地址信息吗?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$Request.getT('/app/indent/delUserAddress', data).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.$queue.showToast("删除成功!");
|
||||
this.oldAddress();
|
||||
} else {
|
||||
this.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.dete {
|
||||
/* flex: 2; */
|
||||
width: 15%;
|
||||
text-align: center;
|
||||
background: #FF7F00;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #ffffff;
|
||||
letter-spacing: 1rpx;
|
||||
border-radius: 15rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.slot-wrap {
|
||||
/* display: flex; */
|
||||
/* align-items: center; */
|
||||
/* 如果您想让slot内容占满整个导航栏的宽度 */
|
||||
/* flex: 1; */
|
||||
/* 如果您想让slot内容与导航栏左右有空隙 */
|
||||
/* padding: 0 30rpx; */
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-left: 100rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.takeaddress {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.part1 {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
margin-top: 24rpx;
|
||||
padding-bottom: 40upx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 90%;
|
||||
height: 80upx;
|
||||
background: #FF7F00;
|
||||
border-radius: 14upx;
|
||||
margin: 0 auto;
|
||||
color: white;
|
||||
text-align: center;
|
||||
line-height: 80upx;
|
||||
letter-spacing: 2upx;
|
||||
margin-top: 40upx;
|
||||
}
|
||||
|
||||
.part2 {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
margin-top: 10upx;
|
||||
}
|
||||
|
||||
.address1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 37rpx;
|
||||
font-weight: bold;
|
||||
padding-top: 30upx;
|
||||
|
||||
}
|
||||
|
||||
.address_box {
|
||||
display: flex;
|
||||
padding-bottom: 30upx;
|
||||
padding-top: 30upx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.address_left {
|
||||
/* flex: 2; */
|
||||
width: 15%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.address_right {
|
||||
/* flex: 10; */
|
||||
width: 80%;
|
||||
font-size: 31rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.add {
|
||||
/* color: #333333; */
|
||||
/* font-size: 31rpx; */
|
||||
/* letter-spacing: 1upx; */
|
||||
}
|
||||
|
||||
.name {
|
||||
display: inline;
|
||||
font-size: 34rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.number {
|
||||
display: initial;
|
||||
color: #999999;
|
||||
font-size: 34rpx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.u-icon__icon {
|
||||
font-size: 45rpx !important;
|
||||
}
|
||||
|
||||
.u-field {
|
||||
padding: 35rpx 28rpx !important;
|
||||
}
|
||||
|
||||
.u-label {
|
||||
flex: 0 0 42px !important;
|
||||
}
|
||||
|
||||
.u-field__input-wrap {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
|
||||
.u-textarea-class {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
</style>
|
||||
525
running/huodong/list.vue
Normal file
@@ -0,0 +1,525 @@
|
||||
<template>
|
||||
<view v-if="XCXIsSelect=='是'">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="hdSwiper flex justify-center" style="top: 80rpx;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="hdSwiper flex justify-center">
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="hdSwiper-box">
|
||||
<swiper :circular="true" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
|
||||
<swiper-item v-for="(item,index) in huodongList.activityImage.split(',')" :key="index">
|
||||
<image :src="item" style="width: 100%;height: 100%;border-radius: 24rpx;" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view style="position: fixed;top: 360rpx;width: 100%;z-index: 999;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view style="position: fixed;top: 290rpx;width: 100%;z-index: 999;">
|
||||
<!-- #endif -->
|
||||
<view class="flex justify-between align-center bg-white padding-tb padding-lr-sm">
|
||||
<view class="flex-sub text-center" :class="current==1?'select':''" @click="confirm(1)">综合排序</view>
|
||||
<view class="flex-sub text-center" :class="current==3?'select':''" @click="confirm(3)">距离优先</view>
|
||||
<view class="flex-sub text-center" :class="current==4?'select':''" @click="confirm(4)">销量优先</view>
|
||||
<view class="flex-sub text-center flex" @click="isShow = !isShow">
|
||||
<view class="flex align-center" style="margin: 0 auto;">
|
||||
<view :class="isShow?'select':''">筛选</view>
|
||||
<u-icon v-if="!isShow" name="arrow-down" size="28"></u-icon>
|
||||
<u-icon v-if="isShow" name="arrow-up" color="#FCD202" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isShow"
|
||||
style="position: absolute;top: 90rpx;width: 100%;z-index: 1000;background: rgba(0,0,0,.5);height: 100vh;"
|
||||
@click="isShow =false">
|
||||
<view class="padding-lr bg-white">
|
||||
<view class="flex justify-between align-center padding-tb-sm u-border-bottom"
|
||||
v-for="(item,index) in options4" :key='index' @click.stop="getSelect(item)">
|
||||
<view class="text-df" :class="item.select?'select':''">{{item.shopTypeName}}</view>
|
||||
<u-icon v-if="item.select" name="checkmark" color="#FCD202" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="padding-lr-sm" style="margin-top: 390rpx;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="padding-lr-sm" style="margin-top: 400rpx;">
|
||||
<!-- #endif -->
|
||||
<view class="" v-for="(item,index) in shopList" :key='index'>
|
||||
<view class="margin-tb-sm flex justify-between bg-white padding"
|
||||
@click="goNav('/pages/index/shop/index?shopId='+item.shopId)">
|
||||
<image :src="item.shopCover" class="radius" style="width: 160rpx;height: 160rpx;"></image>
|
||||
<view class=" margin-left-sm" style="width: 450rpx;">
|
||||
<view class=" flex flex-direction justify-between">
|
||||
<view class="text-lg text-bold text-black">{{item.shopName}}</view>
|
||||
<view class="flex align-center margin-top-xs" style="width: 100%;">
|
||||
<u-icon name="star-fill" color="#FD6416" size="28"></u-icon>
|
||||
<text class="text-lg" style=""> {{item.shopScore?item.shopScore:0}}</text>
|
||||
<text
|
||||
class="text-gray flex-sub margin-left-xs">销量{{item.shopSales?item.shopSales:0}}</text>
|
||||
<text class="text-gray margin-left-xs">{{item.errandTime}}分钟</text>
|
||||
<text class="text-gray margin-left-xs">{{item.distance}}</text>
|
||||
</view>
|
||||
<view class="text-gray margin-top-xs flex justify-between">
|
||||
<view>起送 ¥{{item.minimumDelivery}} 配送 ¥{{item.errandMoney?item.errandMoney:0}}
|
||||
</view>
|
||||
<view style="color: #FCD202;">{{item.autoSendOrder==1?'商家配送':'平台配送'}}</view>
|
||||
</view>
|
||||
<view class="text-gray margin-top-xs" v-if="item.businessHours&&item.lockHours">
|
||||
营业时间:{{item.businessHours}}-{{item.lockHours}}</view>
|
||||
<view class="flex margin-top-xs justify-between align-start" style="width: 100%;">
|
||||
<view class="flex flex-wrap align-center" style="width: 100%;height: 100%;overflow: hidden;">
|
||||
<view class="lable flex justify-center align-center" v-if="item.exemptMinMoney">满{{item.exemptMinMoney}}免配送费</view>
|
||||
<view class="lable flex justify-center align-center" v-for="(ite,ind) in item.shopLable" :key='ind'
|
||||
v-if="item.shopLable">
|
||||
{{ite}}
|
||||
</view>
|
||||
<view class="lable flex justify-center align-center" v-if="item.couponList" style="border-radius: 4rpx;border: 1rpx solid red;background-color: #ffffff;color: red;box-sizing: border-box;" v-for="(it,ide) in item.couponList" :key="ide">满{{it.minMoney}}减{{it.money}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex margin-top-xs">
|
||||
<view v-for="(ite,ind) in item.goodsList" :key='ind'
|
||||
@click.stop="goDet(ite.goodsId,item.shopId)" style="width: 33%;">
|
||||
<image :src="ite.goodsCover" style="width: 120rpx;height: 120rpx;" class="radius"
|
||||
mode=""></image>
|
||||
<view class="u-line-1 text-df text-bold margin-top-xs">{{ite.goodsName}}</view>
|
||||
<view class="text-bold margin-top-xs" style="color: #FD6416;">
|
||||
<text class="text-sm">¥</text> {{ite.goodsMoney}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="!shopList.length"></empty>
|
||||
|
||||
</view>
|
||||
<view v-else>
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
hintShow: false,
|
||||
shop: {},
|
||||
page: 1,
|
||||
limit: 10,
|
||||
|
||||
shopList: [],
|
||||
|
||||
current: 1,
|
||||
shopTypeId: '',
|
||||
userId: '',
|
||||
lng: '',
|
||||
lat: '',
|
||||
value1: 0,
|
||||
value2: 0,
|
||||
value3: 0,
|
||||
value4: 0,
|
||||
options1: [{
|
||||
label: '综合排序',
|
||||
value: 1,
|
||||
}],
|
||||
options2: [{
|
||||
value: '3',
|
||||
label: "距离优先"
|
||||
}],
|
||||
options3: [{
|
||||
value: '4',
|
||||
label: "销量优先"
|
||||
}],
|
||||
options4: [{
|
||||
id: '',
|
||||
select: true,
|
||||
shopTypeName: "全部"
|
||||
}],
|
||||
title: '综合排序',
|
||||
title1: '距离优先',
|
||||
title2: '销量优先',
|
||||
title3: '筛选',
|
||||
totalCount: 0,
|
||||
XCXIsSelect: '否',
|
||||
content:'',
|
||||
huodongList:[],
|
||||
activityTitle:'',
|
||||
activityId:'',
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
|
||||
if (this.XCXIsSelect == '否') {
|
||||
this.getGuize()
|
||||
uni.setNavigationBarTitle({
|
||||
title: '隐私政策'
|
||||
});
|
||||
}
|
||||
let that = this
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
that.shopTypeId = e.value ? e.value : ''
|
||||
that.value2 = e.value ? e.value : 0
|
||||
that.userId = uni.getStorageSync('userId')
|
||||
that.getShopType()
|
||||
uni.getLocation({
|
||||
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
|
||||
success: function(res) {
|
||||
that.lat = res.latitude;
|
||||
that.lng = res.longitude;
|
||||
}
|
||||
});
|
||||
// that.getShopList()
|
||||
if(e.activityTitle){
|
||||
that.activityTitle = e.activityTitle
|
||||
uni.setNavigationBarTitle({
|
||||
title: e.activityTitle
|
||||
});
|
||||
that.getHuoDongList()
|
||||
}
|
||||
if(e.activityId){
|
||||
this.activityId = e.activityId
|
||||
uni.setNavigationBarTitle({
|
||||
title: '推荐商家'
|
||||
});
|
||||
that.getHuoDongList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转商品详情
|
||||
goDet(goodsId, shopId) {
|
||||
let userId = this.$queue.getData('userId');
|
||||
if (!userId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/shop/goodsDet?goodsId=' + goodsId + '&shopId=' + shopId + '&orderType=2'
|
||||
})
|
||||
},
|
||||
//活动列表
|
||||
getHuoDongList(){
|
||||
let data = {
|
||||
activityTitle:this.activityTitle,
|
||||
activityId:this.activityId?this.activityId:''
|
||||
}
|
||||
this.$Request.getT('/app/activityManage/getActivityList',data).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.huodongList = res.data.records[0]
|
||||
this.activityId = this.huodongList.activityId
|
||||
this.getShopList()
|
||||
}
|
||||
});
|
||||
},
|
||||
getGuize() {
|
||||
this.$Request.getT('/app/common/type/237').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.content = res.data.value;
|
||||
// this.tit = res.data.min
|
||||
}
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
|
||||
})
|
||||
},
|
||||
getSelect(e) {
|
||||
console.log(e)
|
||||
this.options4.forEach(res => {
|
||||
if (res.id == e.id) {
|
||||
res.select = true
|
||||
this.page = 1
|
||||
this.shopTypeId = e.id
|
||||
this.getShopList();
|
||||
this.isShow = false
|
||||
} else {
|
||||
res.select = false
|
||||
}
|
||||
})
|
||||
},
|
||||
confirm(e) {
|
||||
console.log(e)
|
||||
this.page = 1
|
||||
this.current = e;
|
||||
|
||||
this.getShopList();
|
||||
},
|
||||
confirm2(e) {
|
||||
console.log(e)
|
||||
this.page = 1
|
||||
this.current = e;
|
||||
|
||||
this.getShopList();
|
||||
},
|
||||
confirm3(e) {
|
||||
console.log(e)
|
||||
this.page = 1
|
||||
this.current = e;
|
||||
|
||||
this.getShopList();
|
||||
},
|
||||
confirm4(e) {
|
||||
console.log(e)
|
||||
this.page = 1
|
||||
this.shopTypeId = e
|
||||
|
||||
this.getShopList();
|
||||
},
|
||||
|
||||
// 商户列表
|
||||
getShopList() {
|
||||
// this.lng = uni.getStorageSync('lng')
|
||||
// this.lat = uni.getStorageSync('lat')
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
screen: this.current,
|
||||
shopTypeId: this.shopTypeId,
|
||||
lng: uni.getStorageSync('lng'),
|
||||
lat: uni.getStorageSync('lat'),
|
||||
activityId:this.activityId
|
||||
}
|
||||
this.$Request.getT('/app/goods/selectShop', data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
console.log(res.data.list)
|
||||
this.totalCount = res.data.totalCount
|
||||
res.data.list.forEach(ret => {
|
||||
if (ret.distance > 1000) {
|
||||
ret.distance = Number((ret.distance / 1000)).toFixed(2) + "km"
|
||||
} else {
|
||||
if (ret.distance == 0) {
|
||||
ret.distance = "0m";
|
||||
} else {
|
||||
ret.distance = Number(ret.distance).toFixed(1) + "m";
|
||||
}
|
||||
}
|
||||
ret.shopLable = ret.shopLable ? ret.shopLable.split(',') : ''
|
||||
ret.shopCover = ret.shopCover ? ret.shopCover.split(',') :
|
||||
'../../static/logo.png'
|
||||
ret.errandTime = Math.round(ret.errandTime)
|
||||
ret.shopScore = ret.shopScore.toFixed(1)
|
||||
})
|
||||
|
||||
|
||||
if (this.page == 1) {
|
||||
this.shopList = res.data.list
|
||||
} else {
|
||||
this.shopList = [...this.shopList, ...res.data.list]
|
||||
}
|
||||
console.log(this.shopList)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 商户类型
|
||||
getShopType() {
|
||||
this.$Request.getT('/app/shoptype/selectShopTypeList').then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.forEach(res => {
|
||||
res.select = false
|
||||
})
|
||||
this.options4 = [...this.options4, ...res.data]
|
||||
}
|
||||
})
|
||||
},
|
||||
goNav(url) {
|
||||
console.log(url)
|
||||
if (this.userId) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
goShopDet(url, e) {
|
||||
this.shop = e
|
||||
console.log(url)
|
||||
if (this.userId) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onReachBottom: function() {
|
||||
if (this.shopList.length < this.totalCount) {
|
||||
this.page = this.page + 1;
|
||||
this.getShopList()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已经到底了',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.select {
|
||||
color: #FCD202;
|
||||
}
|
||||
.hdSwiper{
|
||||
width: 100%;
|
||||
height: 290rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
background-color: #ffffff;
|
||||
.hdSwiper-box{
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
}
|
||||
.tabs {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tabs_name {
|
||||
|
||||
flex: 1;
|
||||
/* display: inline-block; */
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx 0;
|
||||
position: relative;
|
||||
display: flex;
|
||||
/* justify-content: space-between; */
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tabs_name view {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tabs_2 {
|
||||
/* width: 30%; */
|
||||
}
|
||||
|
||||
.actives {
|
||||
color: #007AFF;
|
||||
}
|
||||
|
||||
.tabsicon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 22rpx;
|
||||
width: 20rpx;
|
||||
height: 40rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tabs_icon {
|
||||
width: 12rpx;
|
||||
height: 8rpx;
|
||||
z-index: 1;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.icon1 {
|
||||
/* position: absolute; */
|
||||
/* top: 6rpx; */
|
||||
}
|
||||
|
||||
.icon2 {
|
||||
position: absolute;
|
||||
bottom: 6rpx;
|
||||
}
|
||||
|
||||
|
||||
.hintPopul {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
background: rgba(0, 0, 0, .4);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.content_ {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
width: 500rpx;
|
||||
height: 400rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #fff;
|
||||
padding-top: 120rpx;
|
||||
}
|
||||
|
||||
.content_ image {
|
||||
position: absolute;
|
||||
top: -50rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.hintText {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.skuBtn {
|
||||
width: 460rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
background: #FCD202;
|
||||
font-size: 28rpx;
|
||||
border: 2rpx solid #FCD202;
|
||||
color: #333333;
|
||||
border-radius: 50rpx;
|
||||
font-weight: 700;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.lable {
|
||||
border: 1rpx solid #FFE6D9;
|
||||
height: 40rpx;
|
||||
padding: 0 14rpx;
|
||||
background: #FFE6D9;
|
||||
border-radius: 4rpx;
|
||||
font-weight: 500;
|
||||
color: #FD6416;
|
||||
font-size: 20rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
</style>
|
||||
684
running/index/index.vue
Normal file
@@ -0,0 +1,684 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="margin-lr" v-if="modelSwt == '否'">
|
||||
<view class="">
|
||||
<swiper class="swiper" autoplay="1500" :indicator-dots="true" :circular='true'
|
||||
indicator-active-color="#ffffff" indicator-color="#cccccc">
|
||||
<swiper-item class="swiper-wrap" v-for="(item,index) in bannerList" :key='index'
|
||||
style="height: 300upx;">
|
||||
<image :src="item.imageUrl" style="width: 100%;border-radius: 8upx;height: 300upx;"
|
||||
@click="goWeb(item.url)" mode="scaleToFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between align-center bg-white margin-tb padding-lr-sm radius"
|
||||
style="width: 100%;height: 100rpx;">
|
||||
<image src="../static/xinxi.png" style="width: 126rpx;height: 30rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left-sm">
|
||||
<swiper class="swiper" autoplay="1500" :vertical='true' style="height: 40rpx;overflow: hidden;">
|
||||
<swiper-item class="" v-for="(item,index) in noticeList" :key='index' @click="goWeb1(item.url)">
|
||||
<text>{{item.title}}</text>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-black text-xl text-bold margin-bottom">帮帮跑腿</view>
|
||||
<view class="flex justify-between flex-wrap">
|
||||
<view class="bg-video margin-tb-xs" v-for="(item,index) in classifyLsit" :key='index'
|
||||
@click="goNav(item.url)">
|
||||
<image :src="item.imageUrl" mode="" style="width: 340rpx;height: 200rpx;"></image>
|
||||
<view class="flex flex-direction justify-end"
|
||||
style="position: absolute;top: 0;padding: 30rpx;width: 100%;height: 100%;">
|
||||
<view class="text-white text-lg text-bold">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 红包 -->
|
||||
<view class="hongbao" v-if="HBShow&&paotuiHB == '是'">
|
||||
<view style="width: 52%;margin: 0 auto;position: relative;">
|
||||
<view @click="HBShow=false"
|
||||
style="position: absolute;right: -10rpx;top: -10rpx;font-size: 32rpx;font-weight: bold;">X
|
||||
</view>
|
||||
<image src="../static/hb_bg.png" class="hb_img"></image>
|
||||
<image src="../static/hb_btn.png" class="hb_btn" @click="takemoney()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content" v-if="modelSwt == '是'">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view class="page-body">
|
||||
<view class="page-section page-section-gap">
|
||||
<map id="map" style="width: 100%; height: 700px;" :latitude="latitude" :longitude="longitude"
|
||||
:markers="covers" :show-location="true">
|
||||
<cover-view style="position: fixed;top: 345px;right: 30px;" @click="onToGetLocation()">
|
||||
<cover-image class="img-map1" src="../static/dw.png">
|
||||
</cover-image>
|
||||
</cover-view>
|
||||
</map>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="page-body">
|
||||
<view class="page-section page-section-gap">
|
||||
<map id="map" style="width: 100%; height: 700px;" :latitude="latitude" :longitude="longitude"
|
||||
:markers="covers" :show-location="true" :customCallout="customCallout">
|
||||
<cover-view style="position: fixed;bottom: 430rpx;right: 60rpx;" @click="onToGetLocation()">
|
||||
<cover-image class="img-map1" src="../static/dw.png">
|
||||
</cover-image>
|
||||
</cover-view>
|
||||
</map>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
|
||||
<cover-view class="controls-title">
|
||||
<cover-view class="controls-tabs">
|
||||
<cover-view v-for="(item,index) in classifyLsit" :key="index" v-if="index<4"
|
||||
@tap="change(index,item)" class="atabs_ds">
|
||||
<cover-view>{{item.name}}</cover-view>
|
||||
<cover-view :class="{btna:count == index}"></cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<!-- 同城服务 -->
|
||||
<cover-view class="tabs_box">
|
||||
<cover-view class="pay_tit">
|
||||
<cover-view class="pay_name">请写明{{modelDet.name }}的内容</cover-view>
|
||||
<cover-view class="pay_set">请填写您的具体要求等</cover-view>
|
||||
<cover-view class="pay_radius" @click="bindcity(4)">下单</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="hongbao" v-if="newUserFlag == 1&&paotuiHB == '是'">
|
||||
<cover-view style="width: 52%;margin: 0 auto;position: relative;">
|
||||
<cover-view @click="HBShow=false"
|
||||
style="position: absolute;right: -10rpx;top: -10rpx;font-size: 32rpx;font-weight: bold;">X
|
||||
</cover-view>
|
||||
<cover-image src="../static/hb_bg.png" class="hb_img"></cover-image>
|
||||
<cover-image src="../static/hb_btn.png" class="hb_btn" @click="takemoney()"></cover-image>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<cover-view v-else></cover-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
HBShow: false,
|
||||
modelSwt: "否",
|
||||
modelDet: {},
|
||||
id: 0, // 使用 marker点击事件 需要填写id
|
||||
title: 'map',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
iconPath: '../static/location.png',
|
||||
covers: [{
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
iconPath: '../static/location.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
callout: { //自定义标记点上方的气泡窗口 点击有效
|
||||
content: '当前附近骑手', //文本
|
||||
color: '#ffffff', //文字颜色
|
||||
fontSize: 10, //文本大小
|
||||
padding: 10, //附近留白
|
||||
borderRadius: 2, //边框圆角
|
||||
bgColor: '#00c16f', //背景颜色
|
||||
display: 'ALWAYS', //常显
|
||||
},
|
||||
}],
|
||||
count: "",
|
||||
list: [{
|
||||
id: 0,
|
||||
name: '帮我送'
|
||||
}, {
|
||||
id: 1,
|
||||
name: '帮我取'
|
||||
}, {
|
||||
id: 2,
|
||||
name: '同城帮买'
|
||||
}, {
|
||||
id: 3,
|
||||
name: '同城服务'
|
||||
}],
|
||||
current: 0,
|
||||
value0: '',
|
||||
value1: '',
|
||||
value2: '',
|
||||
value3: '',
|
||||
type: 'text',
|
||||
clearable: false,
|
||||
riderNumber: '',
|
||||
arr: [],
|
||||
|
||||
// 用户红包
|
||||
newUserFlag: 2,
|
||||
|
||||
token: '',
|
||||
bannerList: [],
|
||||
noticeList: [],
|
||||
classifyLsit: [],
|
||||
|
||||
tuiguang: '',
|
||||
tuiguangImg: '',
|
||||
paotuiHB: '否'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getBannerList()
|
||||
this.getNoticeList()
|
||||
// this.getZiZhi()
|
||||
let takeAddress = {
|
||||
data1: '',
|
||||
data2: '',
|
||||
}
|
||||
let closeAddress = {
|
||||
data1: '',
|
||||
data2: '',
|
||||
data3: '',
|
||||
data4: '',
|
||||
citydata: ''
|
||||
}
|
||||
uni.setStorageSync('takeAddress', takeAddress)
|
||||
uni.setStorageSync('closeAddress', closeAddress)
|
||||
if (uni.getStorageSync('disinfo')) {
|
||||
uni.removeStorageSync('disinfo')
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// 首页是否展示地图
|
||||
this.$Request.getT('/app/common/type/294').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.modelSwt = res.data.value
|
||||
this.$queue.setData('modelSwt', res.data.value)
|
||||
}
|
||||
}
|
||||
});
|
||||
this.token = uni.getStorageSync('token')
|
||||
if (this.token) {
|
||||
this.getUser()
|
||||
}
|
||||
|
||||
},
|
||||
onReady() {
|
||||
this.map = uni.createMapContext("map", this)
|
||||
},
|
||||
onShareAppMessage(res) { //发送给朋友
|
||||
return {
|
||||
title: this.tuiguang,
|
||||
path: '/pages/index/index',
|
||||
imageUrl: this.tuiguangImg,
|
||||
}
|
||||
},
|
||||
onShareTimeline(res) { //分享到朋友圈
|
||||
return {
|
||||
title: this.tuiguang,
|
||||
path: '/pages/index/index',
|
||||
imageUrl: this.tuiguangImg,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 分享文案和图片
|
||||
getZiZhi() {
|
||||
this.$Request.getT('/app/common/type/295').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tuiguang = res.data.value;
|
||||
}
|
||||
});
|
||||
this.$Request.getT('/app/common/type/296').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tuiguangImg = res.data.value;
|
||||
}
|
||||
});
|
||||
},
|
||||
goWeb(url) {
|
||||
console.log(url.indexOf('/pages/') !== -1)
|
||||
return
|
||||
if (url.indexOf('/pages/') !== -1) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
} else {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
goWeb1(url) {
|
||||
if (url.indexOf('http') !== -1) {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
// 跳转发布页面
|
||||
goNav(e) {
|
||||
if (this.token) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 获取轮播图
|
||||
getBannerList() {
|
||||
this.$Request.get("/app/banner/selectBannerList?classify=7&state=1").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.bannerList = res.data
|
||||
}
|
||||
});
|
||||
this.$Request.get("/app/banner/selectBannerList?classify=6&state=1").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.classifyLsit = res.data
|
||||
this.modelDet = this.classifyLsit[0]
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取公告
|
||||
getNoticeList() {
|
||||
let data = {
|
||||
page: 1,
|
||||
limit: 100
|
||||
}
|
||||
this.$Request.get("/app/notice/selectNoticeList", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.noticeList = res.data.list
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取用户当前定位
|
||||
getUser() {
|
||||
console.log('执行')
|
||||
var that = this
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(res) {
|
||||
// console.log('成功')
|
||||
// console.log(res)
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
that.longitude = res.longitude
|
||||
that.latitude = res.latitude
|
||||
|
||||
|
||||
that.covers[0].longitude = res.longitude
|
||||
that.covers[0].latitude = res.latitude
|
||||
that.getAdd(that.longitude, that.latitude)
|
||||
that.getuserinfo()
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('授权失败', err)
|
||||
uni.showToast({
|
||||
title: "获取位置授权失败",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//右下角定位按钮的点击事件
|
||||
onToGetLocation() {
|
||||
console.log('11')
|
||||
// this. getUser()
|
||||
// this.map.moveToLocation();
|
||||
let mapContext = uni.createMapContext('map');
|
||||
mapContext.moveToLocation(); //moveToLocation将地图中心移动到当前定位点,需要配合map组件的show-location使用
|
||||
|
||||
|
||||
},
|
||||
// 跑腿人位置
|
||||
getAdd(lng, lat) {
|
||||
this.$Request.getT('/app/tbindent/find5KmRider?lng=' + lng + '&lat=' + lat).then(res => {
|
||||
// console.log('```````````````', res)
|
||||
if (res.code == 0) {
|
||||
this.riderNumber = res.data.length
|
||||
if (res.data.length > 0) {
|
||||
var arr = []
|
||||
|
||||
for (var i in res.data) {
|
||||
var obj = {}
|
||||
obj.latitude = res.data[i].stationLat
|
||||
obj.longitude = res.data[i].stationLng
|
||||
obj.iconPath = '../static/rider.png'
|
||||
obj.width = 30
|
||||
obj.height = 30
|
||||
arr.push(obj)
|
||||
}
|
||||
this.covers[0].callout.content = '当前附近骑手' + res.data.length + '人'
|
||||
// this.covers = arr
|
||||
this.covers = [...this.covers, ...arr];
|
||||
// console.log('this.covers ', this.covers)
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
change(index, item) {
|
||||
// console.log(index)
|
||||
this.modelDet = item
|
||||
this.current = index;
|
||||
this.count = index;
|
||||
console.log(this.count)
|
||||
// uni.removeStorageSync('takeAddress')
|
||||
},
|
||||
bindHelppay(index) {
|
||||
// console.log(index)
|
||||
let token = this.$queue.getData("token");
|
||||
if (token) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helppay/Helppay'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
bindcity(index) {
|
||||
// console.log(index)
|
||||
let token = this.$queue.getData("token");
|
||||
if (token) {
|
||||
uni.navigateTo({
|
||||
url: this.modelDet.url
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 获取用户信息
|
||||
getuserinfo() {
|
||||
this.$Request.getT('/app/tbindent/findUserInfoById').then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.newUserFlag = res.data.newUserFlag
|
||||
console.log(this.newUserFlag)
|
||||
if (this.newUserFlag == 1) {
|
||||
this.paotuiHB = this.$queue.getData('paotuiHB')
|
||||
if (this.paotuiHB == '是') {
|
||||
this.HBShow = true
|
||||
}
|
||||
} else {
|
||||
this.HBShow = false
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 红包
|
||||
takemoney() {
|
||||
this.$Request.getT('/app/tbindent/getNewUserRedPacket').then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.HBShow = false
|
||||
this.getuserinfo()
|
||||
setTimeout(function() {
|
||||
uni.navigateTo({
|
||||
url: '/my/hongbao/hongbao'
|
||||
})
|
||||
}, 100)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
})
|
||||
this.newUserFlag = ''
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0upx;
|
||||
left: 0upx;
|
||||
right: 0upx;
|
||||
bottom: 0upx;
|
||||
|
||||
}
|
||||
|
||||
.controls-title {
|
||||
width: 90%;
|
||||
height: 370upx;
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
margin: 40upx;
|
||||
border-radius: 26upx;
|
||||
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
|
||||
/* #ifndef MP-WEIXIN */
|
||||
width: 90%;
|
||||
margin: 0 40rpx;
|
||||
margin-bottom: 150rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/* tab选项卡 */
|
||||
.controls-tabs {
|
||||
display: flex;
|
||||
font-size: 33rpx;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.atabs_ds {
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
height: 55rpx;
|
||||
}
|
||||
|
||||
/* .tabs_box {
|
||||
display: none;
|
||||
background: #C8C7CC;
|
||||
} */
|
||||
|
||||
.btna {
|
||||
background: #FF6A04;
|
||||
width: 68%;
|
||||
height: 8rpx;
|
||||
margin: 9rpx 10rpx 10rpx 29rpx;
|
||||
border-radius: 35rpx;
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
/* display: none; */
|
||||
}
|
||||
|
||||
.dis {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.controls-tabs {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.box_bg {
|
||||
width: 90%;
|
||||
height: 100upx;
|
||||
background: #FFFFFF;
|
||||
margin: 0 auto;
|
||||
border-radius: 12upx;
|
||||
display: flex;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 90%;
|
||||
height: 100upx;
|
||||
background: #F5F5F5;
|
||||
margin: 0 auto;
|
||||
border-radius: 12upx;
|
||||
display: flex;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.box_dian {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.box_dian cover-image {
|
||||
width: 20upx;
|
||||
height: 20upx;
|
||||
}
|
||||
|
||||
.box_name {
|
||||
flex: 5;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
color: #333333;
|
||||
font-weight: 700;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.box_addres {
|
||||
flex: 5;
|
||||
|
||||
}
|
||||
|
||||
.add {
|
||||
color: #333333;
|
||||
font-size: 26upx;
|
||||
letter-spacing: 2upx;
|
||||
font-weight: bold;
|
||||
line-height: 50upx;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: inline;
|
||||
font-size: 24upx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.number {
|
||||
display: initial;
|
||||
color: #999999;
|
||||
font-size: 24upx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.box_image {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon_you {
|
||||
color: #CCCCCC !important;
|
||||
}
|
||||
|
||||
/* 同城购买 */
|
||||
.pay_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 200upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pay_name {
|
||||
font-size: 31rpx;
|
||||
font-weight: bold;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
letter-spacing: 2upx;
|
||||
}
|
||||
|
||||
.pay_set {
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.pay_radius {
|
||||
width: 100upx;
|
||||
height: 100upx;
|
||||
background: #FF7F00;
|
||||
color: white;
|
||||
text-align: center;
|
||||
line-height: 100upx;
|
||||
border-radius: 68upx;
|
||||
position: absolute;
|
||||
right: 20upx;
|
||||
|
||||
}
|
||||
|
||||
.hongbao {
|
||||
width: 100%;
|
||||
/* height: 100px; */
|
||||
/* background: #007AFF; */
|
||||
position: fixed;
|
||||
top: 24%;
|
||||
/* bottom: 50%; */
|
||||
left: 0rpx;
|
||||
right: 0rpx;
|
||||
/* display: none; */
|
||||
}
|
||||
|
||||
.hb_img {
|
||||
width: 100%;
|
||||
height: 435rpx;
|
||||
}
|
||||
|
||||
.hb_btn {
|
||||
width: 60%;
|
||||
height: 72rpx;
|
||||
position: absolute;
|
||||
top: 315rpx;
|
||||
left: 80rpx;
|
||||
}
|
||||
|
||||
.img-map1 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
</style>
|
||||
93
running/my/css/main.css
Normal file
@@ -0,0 +1,93 @@
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content:center;
|
||||
/* margin-top: 128upx; */
|
||||
}
|
||||
|
||||
/* 头部 logo */
|
||||
.header {
|
||||
text-align: center;
|
||||
|
||||
width:161upx;
|
||||
height:161upx;
|
||||
box-shadow:0upx 0upx 60upx 0upx rgba(0,0,0,0.1);
|
||||
border-radius:50%;
|
||||
background: -moz-linear-gradient(left, #F15B6C, #e10a07 100%);
|
||||
background: -webkit-gradient(linear, left top, left right, color-stop(0, #F15B6C), color-stop(100%, #e10a07));
|
||||
background: -webkit-linear-gradient(left, #F15B6C 0, #e10a07 100%);
|
||||
background: -o-linear-gradient(left, #F15B6C 0, #e10a07 100%);
|
||||
background: -ms-linear-gradient(left, #F15B6C 0, #e10a07 100%);
|
||||
background: linear-gradient(to left, #F15B6C 0, #e10a07 100%);
|
||||
margin-top: 180upx;
|
||||
margin-bottom: 72upx;
|
||||
font-size: 60upx;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
padding-top: 32upx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.header image{
|
||||
width:161upx;
|
||||
height:161upx;
|
||||
border-radius:50%;
|
||||
}
|
||||
|
||||
/* 主体 */
|
||||
.main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 70upx;
|
||||
padding-right: 70upx;
|
||||
}
|
||||
.tips {
|
||||
color: #999999;
|
||||
font-size: 28upx;
|
||||
margin-top: 64upx;
|
||||
margin-left: 48upx;
|
||||
}
|
||||
|
||||
/* 其他登录方式 */
|
||||
.other_login{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 256upx;
|
||||
text-align: center;
|
||||
}
|
||||
.login_icon{
|
||||
border: none;
|
||||
font-size: 64upx;
|
||||
margin: 0 64upx 0 64upx;
|
||||
color: rgba(0,0,0,0.7)
|
||||
}
|
||||
.wechat_color{
|
||||
color: #83DC42;
|
||||
}
|
||||
.weibo_color{
|
||||
color: #F9221D;
|
||||
}
|
||||
.github_color{
|
||||
color: #24292E;
|
||||
}
|
||||
|
||||
/* 底部 */
|
||||
.footer{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 28upx;
|
||||
margin-top: 64upx;
|
||||
color: rgba(0,0,0,0.7);
|
||||
text-align: center;
|
||||
height: 40upx;
|
||||
line-height: 40upx;
|
||||
}
|
||||
.footer text{
|
||||
font-size: 24upx;
|
||||
margin-left: 15upx;
|
||||
margin-right: 15upx;
|
||||
}
|
||||
173
running/my/hongbao/hongbao.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="empty" v-if="moneylist == ''">
|
||||
<view
|
||||
style="display: block; width: 90%; margin: 0 auto; position: fixed;top: 35%;left: 0rpx;right: 0rpx;text-align: center;">
|
||||
<image src="../../../static/image/emety.png" style="width: 300rpx;height: 300rpx;"></image>
|
||||
<view style="color: #CCCCCC;">暂无内容</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_money" v-else>
|
||||
<view class="data_select">
|
||||
<view class="money_box" v-for="(item,index) in moneylist" :key="index">
|
||||
<view class="box_tit">
|
||||
<view class="money_name">{{item.redPacketTitle}}</view>
|
||||
<view class="money_price">¥{{item.redPacketAmount}}</view>
|
||||
</view>
|
||||
<view class="money_data">有效期至{{item.expirationTime}}</view>
|
||||
<view class="money_line">
|
||||
<u-line direction="row" color="#E6E6E6" border-style="dashed" />
|
||||
</view>
|
||||
<view class="box_bottom">
|
||||
<view class="money_use">满{{item.minimumAmount}}元可使用</view>
|
||||
<!-- <view class="money_btn">
|
||||
<view class="lj_use">
|
||||
立即使用
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
moneylist: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.hongbao()
|
||||
},
|
||||
methods: {
|
||||
//获取登录用户的所有红包
|
||||
hongbao() {
|
||||
this.$Request.getT('/app/indent/findAllRedPacket').then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.moneylist = res.data
|
||||
// console.log(this.hongbao)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
/* #ifndef MP-WEIXIN */
|
||||
page {
|
||||
background: #F2EDED;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: 93vh;
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.popup_money {
|
||||
height: 800upx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.u-drawer-bottom {
|
||||
background-color: #FAF7F5 !important;
|
||||
}
|
||||
|
||||
.money_box {
|
||||
width: 93%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
border-radius: 14upx;
|
||||
height: 220rpx;
|
||||
margin-bottom: 20upx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.box_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80upx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.money_name {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2upx;
|
||||
}
|
||||
|
||||
.money_price {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
font-size: 39upx;
|
||||
/* font-weight: bold; */
|
||||
color: red;
|
||||
}
|
||||
|
||||
.money_data {
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
margin-top: -8upx;
|
||||
}
|
||||
|
||||
.u-line {
|
||||
width: 90% !important;
|
||||
border-bottom-width: 6upx !important;
|
||||
margin: 0 auto !important;
|
||||
margin-top: 22upx !important;
|
||||
margin-bottom: 22upx !important;
|
||||
}
|
||||
|
||||
.box_bottom {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
height: 40upx;
|
||||
}
|
||||
|
||||
.money_use {
|
||||
flex: 1;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.lj_use {
|
||||
width: 150rpx;
|
||||
border: 2rpx solid #FF7F00;
|
||||
color: #FF7F00;
|
||||
text-align: center;
|
||||
line-height: 48rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 23rpx;
|
||||
}
|
||||
</style>
|
||||
951
running/order/pay/pay.vue
Normal file
@@ -0,0 +1,951 @@
|
||||
<template>
|
||||
<view class="order_details">
|
||||
<!-- 待支付 -->
|
||||
<view class="part_one">
|
||||
<view>
|
||||
<!-- 订单状态 -->
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 0">待付款</view>
|
||||
<view class="rider_order"
|
||||
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
|
||||
已取消</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 2">待接单</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 3||orderDetails.indentState ==4">派送中</view>
|
||||
<view class="rider_order"
|
||||
v-if="orderDetails.indentState ==5||orderDetails.indentState ==6||orderDetails.indentState ==7">已完成
|
||||
</view>
|
||||
<!-- 订单提示状态 -->
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 2">请耐心等待骑手接单...</view>
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 0">请及时支付订单,否则将自动取消</view>
|
||||
<view class="rider_tit"
|
||||
v-if="orderDetails.indentState ==5||orderDetails.indentState ==6||orderDetails.indentState ==7">
|
||||
写下您的评价感受吧!</view>
|
||||
<view class="rider_tit"
|
||||
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
|
||||
订单已被您取消</view>
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 3||orderDetails.indentState ==4">骑手已接单,尽快为您派送
|
||||
</view>
|
||||
|
||||
<!-- 订单按钮状态 -->
|
||||
<!-- <view style="display: flex;justify-content: flex-end;margin-top: 30rpx;margin-right: 20rpx;">
|
||||
<view class="btn1" @tap.stop="bindcomment(item)"
|
||||
v-if="orderDetails.indentState == 5||orderDetails.indentState ==7">
|
||||
去评论
|
||||
</view>
|
||||
<view class="btn1" v-if="orderDetails.indentState == 0||orderDetails.indentState == 2"
|
||||
@tap.stop="bindorderOff(orderDetails.indentNumber)">取消订单</view>
|
||||
<view class="btn1" @tap.stop="bindconfirm(item)" v-if="orderDetails.indentState == 6">确认订单</view>
|
||||
<view class="btn2" @tap.stop="bindorder(item)" v-if="orderDetails.indentState == 1||orderDetails.indentState == 3||orderDetails.indentState == 5||orderDetails.indentState ==8||
|
||||
orderDetails.indentState ==9||orderDetails.indentState ==10||orderDetails.indentState == 4">再来一单</view>
|
||||
<view class="btn2" v-if="orderDetails.indentState == 0" @tap.stop="bindorder(item)">立即付款</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 购买时间 -->
|
||||
<view class="five_box" style="padding: 30rpx 30rpx;">
|
||||
<text>预约时间</text>
|
||||
<text style="font-weight: bold;">{{orderDetails.sendOutTime}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 同城购买-->
|
||||
<view class="part_three" v-if="orderDetails.indentType == 3">
|
||||
<view class="city_pay">
|
||||
<view class="city_box">同城购买</view>
|
||||
<text v-if="orderDetails.buyType == 0">就近购买</text>
|
||||
<text v-else>指定购买</text>
|
||||
</view>
|
||||
<view class="pay_tit">{{orderDetails.productDetails}}</view>
|
||||
</view>
|
||||
<!-- 同城服务-->
|
||||
<view class="part_three" v-if="orderDetails.indentType == 4">
|
||||
<view class="city_pay">
|
||||
<view class="city_box">同城服务</view>
|
||||
<text>{{orderDetails.serviceType}}</text>
|
||||
</view>
|
||||
<view class="pay_tit">{{orderDetails.serviceDetails}}</view>
|
||||
</view>
|
||||
<!-- 骑手商家地址 -->
|
||||
<view class="part_four">
|
||||
<view class="city_pay" v-if="orderDetails.indentType !=3&&orderDetails.indentType !=4">
|
||||
<view class="city_box" v-if="orderDetails.indentType == 1">帮我送</view>
|
||||
<view class="city_box" v-if="orderDetails.indentType == 2">帮我取</view>
|
||||
<text>{{orderDetails.itemType}}</text>
|
||||
</view>
|
||||
<view v-if="orderDetails.indentType !=3&&orderDetails.indentType != 4">
|
||||
<u-line color="#F2F2F2" />
|
||||
</view>
|
||||
<!-- 发货地址 -->
|
||||
<view class="one_box" v-if="orderDetails.indentType != 4" style="margin-top: 30rpx;">
|
||||
<view class="box_dian">
|
||||
<image src="../../static/icon_f.png"></image>
|
||||
</view>
|
||||
<view class="box_addres">
|
||||
<view class="add">{{orderDetails.shopAddressDetail}}</view>
|
||||
<view class="num">
|
||||
<view class="name" v-if="orderDetails.indentType !=3">
|
||||
{{orderDetails.shopName}} <text>{{orderDetails.shopPhone}}</text>
|
||||
</view>
|
||||
<view class="name" v-else>暂无信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 收获地址 -->
|
||||
<view class="one_box" style="margin-top: 20rpx;margin-bottom: 30rpx;">
|
||||
<view class="box_dian">
|
||||
<image src="../../static/icon_s.png"></image>
|
||||
</view>
|
||||
<view class="box_addres">
|
||||
<view class="add">{{orderDetails.userAddressDetail}}</view>
|
||||
<view class="num">
|
||||
<view class="name">
|
||||
{{orderDetails.userName}}<text>{{orderDetails.userPhone}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-line color="#F2F2F2" />
|
||||
<view class="address_pay">
|
||||
<view class="runing_pay">
|
||||
预估跑腿费
|
||||
</view>
|
||||
<view class="runing_distance">
|
||||
<!-- <text v-if="orderDetails.distance">{{orderDetails.distance/1000}}公里</text> -->
|
||||
<text>¥{{orderDetails.indentBasicsMoney}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 收货码 -->
|
||||
<!-- <view class="five_box"> -->
|
||||
<view class="part_five" v-if="orderDetails.itemCode">
|
||||
<text>收货码</text>
|
||||
<text>{{orderDetails.itemCode}}</text>
|
||||
</view>
|
||||
<!-- 备注 -->
|
||||
<view class="part_five" v-if="orderDetails.remarks">
|
||||
<text>备注</text>
|
||||
<text>{{orderDetails.remarks}}</text>
|
||||
</view>
|
||||
<!-- </view> -->
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="part_six">
|
||||
<view class="order_info">
|
||||
订单信息
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">订单号码</view>
|
||||
<view class="order_nums">{{orderDetails.indentNumber}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">下单时间</view>
|
||||
<view class="order_nums">{{orderDetails.createTime}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">支付方式</view>
|
||||
<view class="order_nums">在线支付</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单下单详情 -->
|
||||
<view class="part_seven">
|
||||
<view class="order_info">
|
||||
费用明细
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">预估跑腿费</view>
|
||||
<view class="order_nums">¥{{orderDetails.indentBasicsMoney}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.tip">
|
||||
<view class="order_name">小费</view>
|
||||
<view class="order_nums">¥{{orderDetails.tip}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.redPacketAmount">
|
||||
<view class="order_name">红包</view>
|
||||
<view class="order_nums">-¥{{orderDetails.redPacketAmount}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.prepayMoney">
|
||||
<view class="order_name">预付价格</view>
|
||||
<view class="order_nums">¥{{orderDetails.prepayMoney}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.cargoInsurance">
|
||||
<view class="order_name">物品保价</view>
|
||||
<view class="order_nums">¥{{orderDetails.cargoInsurance}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name" style="color: black;font-size: 28rpx;">合计</view>
|
||||
<view class="order_nums" style="color: red;font-size: 28rpx;">{{orderDetails.indentMoney}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="pay_bt">
|
||||
<view style="font-size: 32rpx;">价格:¥<text>{{orderDetails.}}</text></view>
|
||||
<view class="btn2" @click="pay()">支付</view>
|
||||
</view> -->
|
||||
<view class="tabbar">
|
||||
<view class="tabbar_price">支付:
|
||||
<text>¥{{orderDetails.indentMoney}}</text>
|
||||
</view>
|
||||
<view class="tabbar_btn">
|
||||
<view class="but" @click="submit()">提交并支付</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="showpay" mode="bottom" close-icon="close-circle" close-icon-pos="top-right"
|
||||
close-icon-color="#8f9298" close-icon-size="50">
|
||||
<view class="popup_pay">
|
||||
<view class="bg margin-top padding-lr radius">
|
||||
<view style="padding: 0 20upx;margin-top: 36rpx;">
|
||||
<view
|
||||
style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
|
||||
v-for="(item,index) in openLists" :key='index'>
|
||||
<image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
|
||||
</image>
|
||||
<view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
|
||||
{{item.text}}
|
||||
</view>
|
||||
<radio-group name="openWay" style="margin-left: 45rpx;" @tap='selectWay(item)'>
|
||||
<label class="tui-radio">
|
||||
<radio color="#FF7F00" :checked="openWay === item.id ? true : false" />
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pay_btns" @click="pay()">确认支付</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderDetails: '',
|
||||
openLists: [],
|
||||
|
||||
showpay: false,
|
||||
openWay: 0,
|
||||
openLists: [],
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.openLists = [{
|
||||
image: '../../static/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}];
|
||||
this.openWay = 2;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '../../static/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
this.openLists = [{
|
||||
image: '../../static/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}, {
|
||||
image: '../../static/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}];
|
||||
this.openWay = 2;
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.openLists = [{
|
||||
image: '../../static/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}];
|
||||
this.openWay = 2;
|
||||
// #endif
|
||||
console.log(data)
|
||||
this.indentNumber = data.indentNumber
|
||||
if (!data) {
|
||||
this.orderDetails = JSON.stringify(data.data)
|
||||
}
|
||||
// console.log(this.orderDetails)
|
||||
this.userList()
|
||||
},
|
||||
methods: {
|
||||
userList() {
|
||||
this.$Request.postT('/app/tbindent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.orderDetails = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.openWay= 2
|
||||
this.pay()
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
this.showpay = true
|
||||
// #endif
|
||||
},
|
||||
selectWay: function(item) {
|
||||
this.openWay = item.id;
|
||||
},
|
||||
pay() {
|
||||
// let indentNumber = this.indentNumber
|
||||
// console.log(data)
|
||||
if (this.openWay == 0) {
|
||||
this.$queue.showToast('请选择支付方式!')
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.openWay == 2) {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序支付
|
||||
this.$Request.postJson("/app/wxErrPay/wxPayJsApiOrder?indentNumber=" + this.indentNumber).then(res => {
|
||||
console.log(res, '********')
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
if (res.code == 0) {
|
||||
console.log(this.openWay, '支付')
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.timestamp,
|
||||
nonceStr: res.data.noncestr,
|
||||
package: res.data.package,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.sign,
|
||||
success: function(suc) {
|
||||
console.log('success:' + JSON.stringify(suc));
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
})
|
||||
uni.setStorageSync('current', 0)
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 10)
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/order/orderDetail/detail?indentNumber=' +indentNumber
|
||||
// })
|
||||
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) { //微信里打开
|
||||
this.$Request.postJson('/app/wxPay/wxPayMpOrder?indentNumber=' + this.indentNumber)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
console.log()
|
||||
this.callPay(res.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
});
|
||||
} else { //不是微信打开
|
||||
this.$Request.postJson('/app/wxPay/wxPayMpOrder?indentNumber=' + this.indentNumber)
|
||||
.then(
|
||||
res => {
|
||||
if (res.code == 0) {
|
||||
console.log('....11111111.....', res.data)
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = res.data //此处form就是后台返回接收到的数据
|
||||
console.log('....2.....', res.data)
|
||||
document.body.appendChild(div)
|
||||
console.log('....33333.....', document.forms[0])
|
||||
document.forms[0].submit()
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 微信APP支付 根据订单id获取支付信息
|
||||
console.log(this.indentNumber)
|
||||
this.$Request.postT("/app/wxPay/payAppOrder", {
|
||||
indentNumber: this.indentNumber
|
||||
}).then(ret => {
|
||||
console.log(JSON.stringify(ret),'支付信息')
|
||||
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
// #endif
|
||||
} else {
|
||||
// APP支付宝支付
|
||||
this.$Request.postJson("/app/aliPay/payAppOrder?indentNumber=" + this.indentNumber).then(ret => {
|
||||
console.log(ret)
|
||||
this.isCheckPay(ret.code, 'alipay', ret.data);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
callPay: function(response) {
|
||||
if (typeof WeixinJSBridge === "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
}
|
||||
} else {
|
||||
this.onBridgeReady(response);
|
||||
}
|
||||
},
|
||||
onBridgeReady: function(response) {
|
||||
let that = this;
|
||||
if (!response.package) {
|
||||
return;
|
||||
}
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest', {
|
||||
"appId": response.appid, //公众号名称,由商户传入
|
||||
"timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
|
||||
"nonceStr": response.noncestr, //随机串
|
||||
"package": response.package,
|
||||
"signType": response.signType, //微信签名方式:
|
||||
"paySign": response.sign //微信签名
|
||||
},
|
||||
function(res) {
|
||||
console.log(res, '/*-/*-/*-')
|
||||
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
uni.navigateBack()
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
}
|
||||
WeixinJSBridge.log(response.err_msg);
|
||||
}
|
||||
);
|
||||
},
|
||||
isCheckPay(status, name, order) {
|
||||
if (status == 0) {
|
||||
this.setPayment(name, order);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付信息有误',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
setPayment(name, order) {
|
||||
console.log(name,'*-*-*',order)
|
||||
uni.requestPayment({
|
||||
provider: name,
|
||||
orderInfo: order, //微信、支付宝订单数据
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
uni.hideLoading();
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000);
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
/* #ifndef MP-WEIXIN */
|
||||
page {
|
||||
background: #F2EDED;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.order_details {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 待支付 */
|
||||
.part_one {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
border-radius: 25rpx;
|
||||
margin-top: 30rpx;
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.city_box {
|
||||
width: 110rpx;
|
||||
line-height: 42rpx;
|
||||
background: #c4e2ff;
|
||||
color: #49A5FF;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.city_pay {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.city_pay text {
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 2rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.rider_order {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
padding-top: 20rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.rider_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
color: #999999;
|
||||
font-size: 31rpx;
|
||||
margin-top: 10rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.order_btn {
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.close_order {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.close_btn {
|
||||
border: 1rpx solid #CCCCCC;
|
||||
width: 245rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
border-radius: 75rpx;
|
||||
font-size: 31rpx;
|
||||
color: #999999;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.tip_order {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.close_tip {
|
||||
width: 245rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
border-radius: 75rpx;
|
||||
font-size: 31rpx;
|
||||
color: white;
|
||||
letter-spacing: 2rpx;
|
||||
background: #FF7F00;
|
||||
}
|
||||
|
||||
/* 骑手商家地址 */
|
||||
.part_four {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 20rpx;
|
||||
background: #FFFFFF;
|
||||
/* height: 390rpx; */
|
||||
border-radius: 25rpx;
|
||||
padding-top: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.u-line {
|
||||
border-bottom-width: 6rpx !important;
|
||||
}
|
||||
|
||||
.one_box {
|
||||
width: 100%;
|
||||
/* height: 100rpx; */
|
||||
/* background: #F5F5F5; */
|
||||
margin: 0 auto;
|
||||
border-radius: 12upx;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
.box_dian {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.box_dian image {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
|
||||
.box_name {
|
||||
flex: 5;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
color: #333333;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.box_addres {
|
||||
flex: 5;
|
||||
|
||||
}
|
||||
|
||||
.add {
|
||||
color: #333333;
|
||||
font-size: 31rpx;
|
||||
letter-spacing: 2upx;
|
||||
font-weight: bold;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: inline;
|
||||
font-size: 22upx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.name text {
|
||||
color: #999999;
|
||||
font-size: 22upx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.address_pay {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx
|
||||
}
|
||||
|
||||
.runing_pay {
|
||||
/* flex: 1; */
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.runing_distance {
|
||||
/* flex: 1; */
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
text-indent: 110rpx;
|
||||
}
|
||||
|
||||
.runing_distance text {
|
||||
font-size: 31rpx;
|
||||
color: black;
|
||||
margin-left: 35rpx;
|
||||
}
|
||||
|
||||
/* 收货码 */
|
||||
.five_box {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
|
||||
.part_five {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 20rpx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
|
||||
.take_number {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
text-indent: 30rpx;
|
||||
}
|
||||
|
||||
.numbers {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
/* 订单信息 */
|
||||
.part_six {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
height: 275rpx;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 25rpx;
|
||||
/* margin-bottom: 100rpx; */
|
||||
}
|
||||
|
||||
.part_seven {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
/* height: 275rpx; */
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 25rpx;
|
||||
margin-bottom: 130rpx;
|
||||
}
|
||||
|
||||
.order_info {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 31rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 3rpx;
|
||||
}
|
||||
|
||||
.order_list {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
height: 60rpx;
|
||||
|
||||
}
|
||||
|
||||
.order_name {
|
||||
flex: 1;
|
||||
color: #999999;
|
||||
font-size: 29rpx;
|
||||
letter-spacing: 2rpx;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.order_nums {
|
||||
flex: 2;
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 2rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 同城服务 */
|
||||
.part_three {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 20rpx;
|
||||
/* height: 250rpx; */
|
||||
/* min-height:200rpx; */
|
||||
background: #FFFFFF;
|
||||
border-radius: 25rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.city_pay {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
/* height: 90rpx; */
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.city_pay text {
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 2rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.city_box {
|
||||
width: 110rpx;
|
||||
line-height: 42rpx;
|
||||
background: #c4e2ff;
|
||||
color: #49A5FF;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.pay_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
width: 170upx;
|
||||
font-size: 22upx;
|
||||
line-height: 60upx;
|
||||
text-align: center;
|
||||
border: 1upx solid #9C9C9C;
|
||||
border-radius: 20upx;
|
||||
color: #9C9C9C;
|
||||
margin-right: 30upx;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
width: 195rpx;
|
||||
line-height: 70rpx;
|
||||
color: white;
|
||||
background: #FF6A04;
|
||||
font-size: 34rpx;
|
||||
text-align: center;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.pay_bt {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #ffffff;
|
||||
height: 110rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0rpx 40rpx;
|
||||
}
|
||||
|
||||
.tabbar {
|
||||
width: 100%;
|
||||
height: 100upx;
|
||||
background: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0upx;
|
||||
left: 0upx;
|
||||
right: 0upx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.tabbar_price {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
font-size: 28upx;
|
||||
font-weight: bold;
|
||||
margin-left: 40upx;
|
||||
}
|
||||
|
||||
.tabbar_price text {
|
||||
color: #FF3333;
|
||||
font-size: 36upx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tabbar_btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.but {
|
||||
background: #FF7F00;
|
||||
width: 200rpx;
|
||||
height: 70rpx;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
border-radius: 60rpx;
|
||||
color: white;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* 支付弹框 */
|
||||
.popup_pay {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pay_btns {
|
||||
width: 90%;
|
||||
margin: 0 auto 40rpx;
|
||||
text-align: center;
|
||||
background: #FF7F00;
|
||||
height: 80rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
</style>
|
||||
BIN
running/static/dw.png
Normal file
|
After Width: | Height: | Size: 793 B |
BIN
running/static/hb_bg.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
running/static/hb_btn.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
running/static/icon_f.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
running/static/icon_qh.png
Normal file
|
After Width: | Height: | Size: 920 B |
BIN
running/static/icon_s.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
running/static/icon_weixin.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
running/static/location.png
Normal file
|
After Width: | Height: | Size: 307 B |
BIN
running/static/mai.png
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
running/static/rider.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
running/static/xinxi.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
running/static/zhifubao.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
406
running/takeaddress/takeaddress.vue
Normal file
@@ -0,0 +1,406 @@
|
||||
<template>
|
||||
<view class="takeaddress">
|
||||
<view class="part1">
|
||||
<view class="name">
|
||||
<u-field v-model="name" placeholder="联系人姓名" icon="account-fill" icon-color="#979799" label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="mobile">
|
||||
<u-field v-model="mobile" type="number" placeholder="联系电话" icon-color="#979799" icon="phone-fill" label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="address" @click="bindmap">
|
||||
<u-field v-model="cityaddress" placeholder="选择地址" :disabled="true" icon-color="#979799" icon="map-fill" label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="detailaddress">
|
||||
<u-field v-model="detailaddress" placeholder="详细地址" icon="map-fill" icon-color="#979799" type="textarea"
|
||||
label-align="center">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="btn" @click="bindtake">确定</view>
|
||||
</view>
|
||||
<view class="part2">
|
||||
<view v-if="oldlist.length>0">
|
||||
<view class="address1">常用地址</view>
|
||||
<view class="address_box" v-for="(item,index) in oldlist" :key="index" @click="goBack(item.addressId)">
|
||||
<view class="address_left">
|
||||
<u-icon name="map-fill" color="#979799"></u-icon>
|
||||
</view>
|
||||
<view class="address_right">
|
||||
<view class="add">
|
||||
{{item.address}}{{item.addressDetail}}
|
||||
</view>
|
||||
<view class="num">
|
||||
<view class="name">{{item.userName}}</view>
|
||||
<view class="number">{{item.userPhone}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap.stop='deleteAddressList(item)' class="dete">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view v-else>
|
||||
<view style="width: 50%;margin: 0 auto;">
|
||||
<image src="../../static/image/emety.png" style="width: 100%;height: 390rpx;"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mobile: '',
|
||||
name: '',
|
||||
cityaddress: '',
|
||||
detailaddress: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
oldlist: [],
|
||||
type: 1,
|
||||
addressType: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
if (e.index) {
|
||||
this.type = e.index
|
||||
}
|
||||
if (e.addressType) {
|
||||
this.addressType = e.addressType
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.oldAddress()
|
||||
},
|
||||
methods: {
|
||||
bindtake() {
|
||||
let that = this
|
||||
let address = uni.getStorageSync('takeAddress')
|
||||
if (that.mobile.length != 11) {
|
||||
uni.showToast({
|
||||
title: '请正确输入收货人联系电话',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!/^1[3456789]\d{9}$/.test(that.mobile)) {
|
||||
uni.showToast({
|
||||
title: '请正确输入收货人联系电话',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.name == '') {
|
||||
uni.showToast({
|
||||
title: '请输入取货人姓名',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.cityaddress == '') {
|
||||
uni.showToast({
|
||||
title: '请输入取货地址',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.detailaddress == '') {
|
||||
uni.showToast({
|
||||
title: '请输入详细地址',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
// uni.setStorageSync('takeAddress', address)
|
||||
//取件地址
|
||||
console.log(address)
|
||||
let userId = that.$queue.getData('userId');
|
||||
let data = {
|
||||
type: that.type,
|
||||
userPhone: that.mobile,
|
||||
userName: that.name,
|
||||
address: that.cityaddress, ///注释
|
||||
addressDetail: that.detailaddress,
|
||||
addressLatitude: that.latitude,
|
||||
addressLongitude: that.longitude,
|
||||
userId: userId
|
||||
}
|
||||
that.$Request.postJson('/app/tbindent/addUserAddress', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$queue.showToast("地址保存成功!");
|
||||
// uni.navigateBack();
|
||||
setTimeout(function(){
|
||||
that.goBack(res.data)
|
||||
},500)
|
||||
} else {
|
||||
that.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击地址返回上一页
|
||||
goBack(e) {
|
||||
console.log(e)
|
||||
uni.setStorageSync('addressId',e)
|
||||
uni.setStorageSync('addressType',this.addressType)
|
||||
setTimeout(function(){
|
||||
uni.navigateBack()
|
||||
},10)
|
||||
},
|
||||
// 常用地址
|
||||
bindback(e) {
|
||||
console.log(e)
|
||||
let address = uni.getStorageSync('takeAddress')
|
||||
// console.log(e)
|
||||
// this.data1 = e
|
||||
let add = {
|
||||
addressId: e.addressId,
|
||||
shipUserPhone: e.userPhone,
|
||||
shipUserName: e.userName,
|
||||
shipAddress: e.address, ///注释
|
||||
shipAddressDetail: e.addressDetail,
|
||||
userId: e.userId,
|
||||
shipAddressLatitude: e.addressLatitude,
|
||||
shipAddressLongitude: e.addressLongitude
|
||||
}
|
||||
if (this.type == 1) {
|
||||
address.data1 = add
|
||||
uni.navigateBack()
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// })
|
||||
} else if (this.type == 2) {
|
||||
address.data1 = add
|
||||
uni.navigateBack()
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// })
|
||||
}
|
||||
uni.setStorageSync("takeAddress", address)
|
||||
|
||||
// console.log(uni.getStorageSync("takeAddress"))
|
||||
// if (this.type == 1) {
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// })
|
||||
// }
|
||||
|
||||
},
|
||||
bindmap() {
|
||||
var that = this
|
||||
// if (that.address == '') {
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
|
||||
console.log('位置名称:' + res);
|
||||
// console.log('详细地址:' + res.address);
|
||||
// console.log('纬度:' + res.latitude);
|
||||
// console.log('经度:' + res.longitude);
|
||||
that.detailaddress = res.name
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
that.shengcheng(res.longitude, res.latitude)
|
||||
}
|
||||
});
|
||||
// }
|
||||
|
||||
},
|
||||
shengcheng(longitude, latitude) {
|
||||
this.$Request.getT('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
|
||||
// console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.cityaddress = res.data.province + res.data.city + res.data.district
|
||||
console.log(this.cityaddress)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 获取常用地址列表
|
||||
oldAddress() {
|
||||
this.$Request.getT('/app/tbindent/findUserAddress').then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.oldlist = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除常用地址
|
||||
deleteAddressList(e) {
|
||||
console.log(e)
|
||||
let data = {
|
||||
userName: e.userName,
|
||||
userPhone: e.userPhone,
|
||||
address: e.address,
|
||||
addressDetail: e.addressDetail,
|
||||
addressLatitude: e.addressLatitude,
|
||||
addressLongitude: e.addressLongitude,
|
||||
userId: e.userId,
|
||||
addressId: e.addressId,
|
||||
addressDefault: e.addressDefault
|
||||
}
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '您确定要删除此地址信息吗?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$Request.getT('/app/indent/delUserAddress', data).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.$queue.showToast("删除成功!");
|
||||
this.oldAddress();
|
||||
} else {
|
||||
this.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.dete {
|
||||
/* flex: 2; */
|
||||
width: 15%;
|
||||
text-align: center;
|
||||
background: #FF7F00;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #ffffff;
|
||||
letter-spacing: 1rpx;
|
||||
border-radius: 15rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.slot-wrap {
|
||||
/* display: flex; */
|
||||
/* align-items: center; */
|
||||
/* 如果您想让slot内容占满整个导航栏的宽度 */
|
||||
/* flex: 1; */
|
||||
/* 如果您想让slot内容与导航栏左右有空隙 */
|
||||
/* padding: 0 30rpx; */
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-left: 100rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.takeaddress {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.part1 {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
margin-top: 24rpx;
|
||||
padding-bottom: 40upx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 90%;
|
||||
height: 80upx;
|
||||
background: #FF7F00;
|
||||
border-radius: 14upx;
|
||||
margin: 0 auto;
|
||||
color: white;
|
||||
text-align: center;
|
||||
line-height: 80upx;
|
||||
letter-spacing: 2upx;
|
||||
margin-top: 40upx;
|
||||
}
|
||||
|
||||
.part2 {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
margin-top: 10upx;
|
||||
}
|
||||
|
||||
.address1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 37rpx;
|
||||
font-weight: bold;
|
||||
padding-top: 30upx;
|
||||
|
||||
}
|
||||
|
||||
.address_box {
|
||||
display: flex;
|
||||
padding-bottom: 30upx;
|
||||
padding-top: 30upx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.address_left {
|
||||
/* flex: 2; */
|
||||
width: 15%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.address_right {
|
||||
/* flex: 10; */
|
||||
width: 80%;
|
||||
font-size: 31rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.add {
|
||||
/* color: #333333; */
|
||||
/* font-size: 31rpx; */
|
||||
/* letter-spacing: 1upx; */
|
||||
}
|
||||
|
||||
.name {
|
||||
display: inline;
|
||||
font-size: 34rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.number {
|
||||
display: initial;
|
||||
color: #999999;
|
||||
font-size: 34rpx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
.u-icon__icon {
|
||||
font-size: 45rpx !important;
|
||||
}
|
||||
|
||||
.u-field {
|
||||
padding: 35rpx 28rpx !important;
|
||||
}
|
||||
|
||||
.u-label {
|
||||
flex: 0 0 42px !important;
|
||||
}
|
||||
.u-field__input-wrap {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
.u-textarea-class {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
</style>
|
||||