首次提交

This commit is contained in:
duan
2024-06-06 11:50:53 +08:00
parent cab4751927
commit 544c3b65b2
344 changed files with 72919 additions and 1 deletions

1806
pages/index/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,636 @@
<template>
<view class="content">
<view class="search-box">
<!-- mSearch组件 如果使用原样式删除组件元素-->
<!-- <mSearch class="mSearch-input-box" :mode="2" button="inside" :placeholder="defaultKeyword"
@search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)" v-model="keyword"></mSearch> -->
<!-- 原样式 如果使用原样式恢复下方注销代码 -->
<!-- <view class="input-box">
<input type="text" :adjust-position="true" :placeholder="defaultKeyword" @input="inputChange" v-model="keyword" @confirm="doSearch(false)"
placeholder-class="placeholder-class" confirm-type="search">
</view>
<view class="search-btn" @tap="doSearch(false)">搜索</view> -->
<view class="margin-lr">
<u-search style="width: 100%;" placeholder="请输入商家或者商品名称" :focus="true" v-model="keyword"
:show-action="true" :animation="true" shape="square" action-text="取消" @custom="goBack()"
@search="doSearch(false)">
</u-search>
</view>
<!-- <u-dropdown v-show="isShowKeywordList">
<u-dropdown-item v-model="value1" :title="title" :options="options1" @change="confirm">
</u-dropdown-item>
<u-dropdown-item v-model="value2" :title="title1" :options="options2" @change="confirm2">
</u-dropdown-item>
</u-dropdown> -->
<view v-show="isShowKeywordList" style="width: 100%;z-index: 999;">
<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: 150rpx;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>
<!-- 原样式 end -->
<!-- 活动筛选 -->
<view class="hd flex justify-center" v-if="hdlist.length>0 && isShowKeywordList">
<view class="hd-box">
<scroll-view scroll-x="true" class="scroll-view_H">
<view class="hd-box-item" :style="currenthd==index?'background-color:#fcd202;font-weight:bold':''" @click="searchhd(index,item.activityId)" v-for="(item,index) in hdlist" :key="index">{{item.activityTitle}}</view>
</scroll-view>
</view>
</view>
</view>
<view class="search-keyword">
<view class="keyword-list-box" v-show="isShowKeywordList" scroll-y>
<view class="padding-lr">
<view class="" v-for="(item,index) in keywordList" :key='index'>
<view class=" flex justify-between bg-white padding" style="margin-bottom: 20rpx;"
@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>
<!-- <view v-if="keywordList.length == 0">
暂无数据
</view> -->
<empty v-if="keywordList.length == 0"></empty>
</view>
<view class="keyword-box" v-show="!isShowKeywordList" scroll-y>
<view class="keyword-block" v-if="hotKeywordList.length>0">
<view class="keyword-list-header">
<view>热门搜索</view>
<view>
<image @tap="hotToggle" :src="'/static/images/index/attention'+forbid+'.png'"></image>
</view>
</view>
<view class="keyword" v-if="forbid==''">
<view v-for="(keyword,index) in hotKeywordList" @tap="doSearch(keyword)" :key="index">
{{keyword}}
</view>
</view>
<view class="hide-hot-tis" v-else>
<view>当前搜热已隐藏</view>
</view>
</view>
<view class="keyword-block" v-if="oldKeywordList.length>0">
<view class="keyword-list-header">
<view>历史记录</view>
<view>
<image @tap="oldDelete" src="/static/images/index/delete.png"></image>
</view>
</view>
<view class="keyword">
<view v-for="(keyword,index) in oldKeywordList" @tap="doSearch(keyword.message)" :key="index">
{{keyword.message}}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
currenthd:-1,
hdlist:[],
activityId:'',
isShow: false,
defaultKeyword: "",
keyword: "",
oldKeywordList: [], //历史记录
hotKeywordList: [], //热搜
keywordList: [], //搜索列表
forbid: '',
isShowKeywordList: false,
limit: 10,
page: 1,
userId: '',
isVip: false,
lng: '',
lat: '',
value1: 1,
value2: 0,
options1: [{
label: '综合排序',
value: 1,
},
{
label: '距离优先',
value: 3,
},
{
label: '销量优先',
value: 4,
}
],
options2: [{
value: '',
label: "全部"
}],
options4: [{
id: '',
select: true,
shopTypeName: "全部"
}],
current: 1,
shopTypeId: '',
title: '综合排序',
title1: '筛选',
totalCount: 0
}
},
onLoad() {
let that = this
this.getSearchList()
this.gethdlist();
this.userId = uni.getStorageSync('userId') ? uni.getStorageSync('userId') : ''
this.lng = uni.getStorageSync('lng')
this.lat = uni.getStorageSync('lat')
this.getShopType()
this.isVip = uni.getStorageSync('isVIP')
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function(res) {
// that.lat = res.latitude;
// that.lng = res.longitude;
}
});
},
methods: {
//筛选活动
searchhd(index,activityId){
if(index==this.currenthd){
this.currenthd = -1
this.activityId = '';
this.doSearch(false);
}else{
this.currenthd = index;
this.activityId=activityId;
this.doSearch(false);
}
},
//获取所有活动
gethdlist(){
this.$Request.get("/app/activityManage/getActivityList").then(res => {
if (res.code == 0) {
res.data.records.map((item,index)=>{
if(item.activityId==14){
res.data.records.splice(index, 1)
}
})
this.hdlist = res.data.records
}
});
},
getSelect(e) {
this.options4.forEach(res=>{
if(res.id == e.id) {
res.select = true
this.page = 1
this.shopTypeId = e.id
// this.getShopList();
this.doSearch(this.keyword);
this.isShow = false
} else {
res.select = false
}
})
},
confirm(e) {
console.log(e)
this.page = 1
this.current = e;
this.doSearch(this.keyword);
},
confirm2(e) {
console.log(e)
this.page = 1
this.shopTypeId = e
if (e == 0) {
this.title1 = '筛选'
} else {
this.title1 = this.options2[e].label
}
this.doSearch(this.keyword);
},
// 获取搜索历史
getSearchList() {
let data = {
page: this.page,
limit: this.limit,
}
this.$Request.get("/app/searchhistory/selectSearchHistory", data).then(res => {
console.log(res)
if (res.code == 0) {
this.oldKeywordList = res.data.list
}
});
this.$Request.getT('/app/common/type/309').then(res => { //订单状态通知
if (res.code == 0) {
this.hotKeywordList = res.data.value.split(',')
}
})
},
//清除历史搜索
oldDelete() {
uni.showModal({
content: '确定清除历史搜索记录?',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
this.$Request.get("/app/searchhistory/deleteSearchHistory").then(res => {
if (res.code == 0) {
this.getSearchList()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//执行搜索
doSearch(keyword) {
this.keyword = keyword === false ? this.keyword : keyword;
this.isShowKeywordList = true;
if (!this.keyword) {
uni.showToast({
title: '请输入内容',
icon: 'none',
duration: 1000
})
return
}
let data = {
impotr: this.keyword,
screen: this.current,
shopTypeId: this.shopTypeId,
limit: this.limit,
page: this.page,
lng: this.lng,
lat: this.lat,
userId: this.userId,
activityId:this.activityId
}
this.$Request.get("/app/goods/selectShop", data).then(res => {
if (res.code == 0) {
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.errandTime = Math.round(ret.errandTime)
ret.shopScore = ret.shopScore.toFixed(1)
})
if (this.page == 1) this.keywordList = [];
this.keywordList = [...this.keywordList, ...res.data.list]
}
});
},
// 商户类型
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]
}
})
},
// 点击取消返回首页
goBack() {
uni.navigateBack()
},
//热门搜索开关
hotToggle() {
this.forbid = this.forbid ? '' : '_forbid';
},
// 跳转商品详情
goDet(goodsId, shopId) {
uni.navigateTo({
url: '/pages/index/shop/goodsDet?goodsId=' + goodsId + '&shopId=' + shopId + '&orderType=1'
})
},
goNav(url) {
console.log(url)
if (this.userId) {
uni.navigateTo({
url
})
} else {
uni.navigateTo({
url: '/pages/public/login'
})
}
},
// 跳转订单
goOrder(e) {
if (this.userId) {
uni.navigateTo({
url: '/pages/index/game/order?id=' + e.id
});
} else {
uni.navigateTo({
url: '/pages/public/login'
});
}
},
},
onReachBottom: function() {
// this.page = this.page + 1;
// this.doSearch(false);
if(this.keywordList.length<this.totalCount) {
this.page = this.page + 1;
this.doSearch(false);
} else {
uni.showToast({
title: '已经到底了',
icon: 'none'
})
}
},
onPullDownRefresh: function() {
this.page = 1;
this.doSearch(false);
},
}
</script>
<style lang="scss">
page {
/* background-color: #FFFFFF; */
}
.hd{
width: 100%;
height: auto;
// margin-top: 20rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
background-color: rgb(248,248,248);
.hd-box{
width: 686rpx;
height: 100%;
.scroll-view_H{
width: 100%;
white-space: nowrap;
}
.hd-box-item{
display: inline-block;
padding: 10rpx 20rpx 10rpx 20rpx;
background-color: #ffffff;
font-size: 24rpx;
border-radius: 8rpx;
margin-right: 10rpx;
}
}
}
.select{
color: #FCD202;
}
.search-box {
width: 100%;
/* background-color: rgb(242, 242, 242); */
padding: 15upx 0 0;
/* display: flex; */
/* justify-content: space-between; */
position: sticky;
top: 0;
background-color: #FFF;
z-index: 99;
}
.search-box .mSearch-input-box {
width: 100%;
}
.search-box .input-box {
width: 85%;
flex-shrink: 1;
display: flex;
justify-content: center;
align-items: center;
}
.search-box .search-btn {
width: 15%;
margin: 0 0 0 2%;
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
font-size: 28upx;
/* color: #fff; */
background: linear-gradient(to right, #ff9801, #ff570a);
border-radius: 60upx;
}
.search-box .input-box>input {
width: 100%;
height: 60upx;
font-size: 32upx;
border: 0;
border-radius: 60upx;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0 3%;
margin: 0;
background-color: #ffffff;
}
.placeholder-class {
color: #9e9e9e;
}
.search-keyword {
width: 100%;
/* background-color: #111224; */
}
.keyword-list-box {
height: calc(100vh - 110upx);
/* padding-top: 10upx; */
/* border-radius: 20upx 20upx 0 0; */
/* background-color: #fff; */
}
.keyword-entry-tap {
background-color: #eee;
}
.keyword-entry {
width: 94%;
height: 80upx;
margin: 0 3%;
font-size: 30upx;
color: #333;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: solid 1upx #e7e7e7;
}
.keyword-entry image {
width: 60upx;
height: 60upx;
}
.keyword-entry .keyword-text,
.keyword-entry .keyword-img {
height: 80upx;
display: flex;
align-items: center;
}
.keyword-entry .keyword-text {
width: 90%;
}
.keyword-entry .keyword-img {
width: 10%;
justify-content: center;
}
.keyword-box {
height: calc(100vh - 110upx);
/* border-radius: 20upx 20upx 0 0; */
/* background-color: #111224; */
}
.keyword-box .keyword-block {
padding: 10upx 0;
}
.keyword-box .keyword-block .keyword-list-header {
width: 94%;
padding: 10upx 3%;
font-size: 27upx;
font-weight: 700;
/* color: #FFFFFF; */
display: flex;
justify-content: space-between;
}
.keyword-box .keyword-block .keyword-list-header image {
width: 40upx;
height: 40upx;
}
.keyword-box .keyword-block .keyword {
width: 94%;
padding: 3px 3%;
display: flex;
flex-flow: wrap;
justify-content: flex-start;
}
.keyword-box .keyword-block .hide-hot-tis {
display: flex;
justify-content: center;
font-size: 28upx;
/* color: #FFFFFF; */
}
.keyword-box .keyword-block .keyword>view {
display: flex;
justify-content: center;
align-items: center;
border-radius: 10upx;
padding: 0 20upx;
margin: 10upx 20upx 10upx 0;
height: 60upx;
font-size: 28upx;
background-color: #eee;
/* color: #FFFFFF; */
}
.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>

View File

@@ -0,0 +1,549 @@
<template>
<view class="container">
<view class="flex align-center" style="background:#fff;">
<view class="content padding-left bg-white" style="color: #333;font-size: 28upx;font-weight: bold;"
v-if="city">
<text @click="goCity()">{{city}}<text class="cuIcon-right"></text></text>
</view>
<view class="padding-tb-sm padding-lr-xs margin-right-xs flex-sub">
<view class="search-bar-form">
<view class="search-bar-box">
<icon class="icon-search-in-box" type="search" size="16"></icon>
<input confirm-type="search" class="search-bar-input" placeholder="输入地址查询"
placeholder-class="phcolor" :value="inputVal" :focus="inputShowed" @input="inputTyping" />
<view class="icon-clear" v-if="inputVal" @tap="clearInput">
<!-- #ifdef APP-PLUS || MP -->
<icon type="clear" :size="15"></icon>
<!-- #endif -->
</view>
</view>
</view>
</view>
</view>
<view class="tui-list search-result " v-if="inputShowed">
<view class="padding margin-lr radius flex justify-between align-center"
v-for="(item,index) in searchResult" :key="index" @click="update(item)">
<view>
<view class="text-lg text-bold text-black">{{item.addressDetail}}</view>
<view class="text-df text-gray margin-top-xs">{{item.province}}{{item.city}}{{item.district}}</view>
</view>
</view>
</view>
<view v-else>
<view class="tui-list city-list " v-if="list&&list.length>0">
<view class="flex justify-between">
<view class="title text-lg text-bold padding-sm padding-top-sm">我的地址</view>
<view style="display: flex;align-items: center;font-size: 26rpx;" class="padding-sm padding-top-sm" @tap="goAddressList">
<view>地址管理</view>
<image src="../../static/images/index/right2.png" style="width: 12rpx;height: 20rpx;margin-left: 6rpx;"></image>
</view>
</view>
<view class="padding margin-lr radius flex justify-between align-center" v-for="(item,index) in list"
:key="index" v-if="index == 0" @click="update(item)" style="border: 2rpx solid #FCD202;">
<view>
<view class="text-lg text-bold text-black">{{item.addressDetail}}</view>
<view class="text-df text-gray margin-top-xs">{{item.province}}{{item.city}}{{item.district}}
</view>
</view>
<u-icon name="checkbox-mark" color="#FCD202" size="42"></u-icon>
</view>
<view class="padding margin-lr radius flex justify-between align-center" v-for="(item,index) in list"
:key="index" v-if="index > 0" @click="update(item)">
<view>
<view class="text-lg text-bold text-black">{{item.addressDetail}}</view>
<view class="text-df text-gray margin-top-xs">{{item.province}}{{item.city}}{{item.district}}
</view>
</view>
</view>
</view>
</view>
<!-- 添加收货地址 -->
<view class="btn">
<view class="address_push" @click="addAddress">添加收货地址</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
region: [],
inputVal: '', // 搜索框输入的内容
inputShowed: false, // 输入框是否显示
list: [],
searchResult: [], // 搜索城市的结果
localCampus: '',
campusDetails: '',
txt: '选择城市',
province: '', //省
city: '', //市
district: '', //区
page: 1,
limit: 10,
totalCount: 0,
longitude: '',
latitude: ''
}
},
onLoad: function(options) {
console.log(options)
if (uni.getStorageSync('city')) {
this.city = uni.getStorageSync('city')
this.longitude = uni.getStorageSync('lng')
this.latitude = uni.getStorageSync('lat')
} else {
this.getlocation()
}
},
onShow() {
if (uni.getStorageSync('userId')) {
this.initCampusList()
}
},
methods: {
goAddressList() {
uni.navigateTo({
url: '/my/address/index'
});
},
update(e) {
let data = {
addressId: e.addressId,
addressDefault: 1,
}
this.$Request.postJson("/app/address/updateAddress", data).then(res => {
if (res.code == 0) {
uni.removeStorageSync('city')
uni.removeStorageSync('lng')
uni.removeStorageSync('lat')
setTimeout(function() {
uni.navigateBack()
}, 10)
}
});
},
goCity() {
let that = this
uni.chooseLocation({
success: function(res) {
console.log(res, '选择');
that.longitude = res.longitude
that.latitude = res.latitude
that.city = res.name
uni.setStorageSync('lng', that.longitude)
uni.setStorageSync('lat', that.latitude)
uni.setStorageSync('city', res.name)
setTimeout(function() {
uni.navigateBack()
}, 10)
}
});
},
getlocation() {
let that = this
// that.list=[]
uni.getLocation({
type: 'gcj02',
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
that.longitude = res.longitude
that.latitude = res.latitude
let data = {
lat: res.latitude,
lng: res.longitude
}
that.$Request.get("/app/address/selectCity", data).then(res => {
if (res.code == 0) {
that.city = res.data.city
}
});
// that.initCampusList();
}
});
},
//获取社区列表
initCampusList() {
let that = this;
let data = {
page: that.page,
limit: that.limit,
}
that.$Request.getT('/app/address/selectAddressList', data).then(res => {
console.log(res)
if (res.code === 0) {
if (that.page == 1) {
that.list = res.data.list
} else {
that.list = [...that.list, ...res.data.list]
}
}
})
},
showInput() {
this.inputShowed = true
},
clearInput() {
this.inputVal = "";
this.inputShowed = false;
this.searchResult = [];
uni.hideKeyboard() //强行隐藏键盘
},
inputTyping(e) {
this.inputVal = e.detail.value;
if (e.detail.value.length === 0) {
this.searchResult = [];
this.inputShowed = false
} else {
this.inputShowed = true
}
this.searchCity()
},
// 搜索城市
searchCity() {
let data = {
impotr: this.inputVal,
page: 1,
limit: 1000
}
this.$Request.get("/app/address/searchAddress", data).then(res => {
if (res.code == 0) {
this.searchResult = res.data.list
}
});
},
// 添加地址
addAddress() {
let userId = this.$queue.getData('userId');
if (!userId) {
uni.navigateTo({
url: '/pages/public/login'
})
return
}
uni.navigateTo({
url: '/my/address/add'
})
},
},
onReachBottom: function() {
this.page = this.page + 1;
this.initCampusList();
},
onPullDownRefresh: function() {
this.page = 1;
this.initCampusList();
},
}
</script>
<style lang="scss">
page {
height: 100%;
background: #FFFFFF;
}
.page {
height: 100%;
overflow: hidden;
}
.search-bar {
display: flex;
align-items: center;
position: relative;
padding: 27rpx 30rpx 35rpx;
background-color: #fff;
}
.search-bar-form {
flex: 1;
position: relative;
border-radius: 32rpx;
background: #f2f5f7;
}
.search-bar-box {
display: flex;
align-items: center;
position: relative;
padding-left: 20rpx;
padding-right: 20rpx;
height: 64rpx;
z-index: 1;
}
.search-bar-input {
line-height: normal;
width: 100%;
padding-left: 20rpx;
font-size: 30rpx;
color: #333;
}
.phcolor {
font-size: 30rpx;
}
.icon-clear {
height: 38rpx;
}
.icon-clear .tui-icon-class {
display: block
}
.search-bar-label {
height: 64rpx;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
border-radius: 32rpx;
color: #ccc;
background: #f2f5f7;
}
.icon-search {
position: relative;
height: 26rpx;
margin-right: 20rpx;
font-size: inherit;
}
.search-bar-text {
font-size: 30rpx;
line-height: 32rpx;
}
.cancel-btn {
padding-left: 30rpx;
}
.search-result::before {
display: none;
}
.search-result::after {
display: none;
}
.tui-list-cell {
// padding: 30upx;
// display: flex;
// flex-direction: row;
// justify-content: space-between;
// align-items: center;
// width: 100%;
}
.tui-list-cell-hover {
// background-color: #eee !important;
}
.tui-list-cell-navigate {
// width: 100%;
// position: relative;
// padding: 30rpx 0 30rpx 30rpx;
font-size: 30rpx;
color: #333;
font-weight: 800;
}
.tui-list-cell-navigate::after {
content: '';
position: absolute;
border-bottom: 1rpx solid #eaeef1;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
bottom: 0;
right: 0;
left: 30rpx;
}
.current-city {
padding: 0 30rpx 30rpx;
background: #fff;
}
.tui-icon-class {
margin-right: 10rpx;
}
.current-city .title {
font-size: 28rpx;
line-height: 24rpx;
color: #333333;
}
.box {
background: #F5F5F5;
border-radius: 10upx;
width: 686upx;
// height: 134upx;
}
.city-name {
display: flex;
align-items: center;
// margin-top: 17rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 30rpx;
color: #333;
}
.hot-city .title {
height: 48rpx !important;
padding-left: 30rpx;
font-size: 24rpx !important;
line-height: 48rpx !important;
color: #999;
background: #f2f5f7 !important;
}
.city-names {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
padding: 12rpx 90rpx 26rpx 30rpx;
background: #fff;
}
.city-name-item {
display: flex;
justify-content: center;
align-items: center;
width: 140rpx;
height: 56rpx;
margin-top: 16rpx;
/* border: solid 1rpx #ccc; */
border-radius: 28rpx;
font-size: 28rpx;
color: #333;
position: relative;
}
.city-name-item::before {
content: "";
position: absolute;
width: 200%;
height: 200%;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scale(0.5, 0.5);
transform: scale(0.5, 0.5);
-webkit-box-sizing: border-box;
box-sizing: border-box;
left: 0;
top: 0;
border-radius: 56rpx;
border: 1px solid #ccc;
}
.tap-city {
color: #fff;
background: #5677fc;
/* border: solid 1rpx #5677fc; */
}
.tui-list {
background-color: #fff;
position: relative;
width: 100%;
display: flex;
flex-direction: column;
padding-bottom: env(safe-area-inset-bottom);
}
.tui-list-cell-divider {
height: 48rpx;
padding-left: 30rpx;
font-size: 24rpx;
color: #999;
background: #f2f5f7;
padding: 0 30rpx;
display: flex;
align-items: center;
}
.tui-indexed-list-bar {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
z-index: 9999;
position: absolute;
top: 132rpx;
right: 0;
padding-right: 10rpx;
width: 44rpx;
}
.tui-indexed-list-text {
font-size: 22rpx;
white-space: nowrap;
}
.tui-indexed-list-bar.active {
background-color: rgb(200, 200, 200);
}
.tui-indexed-list-alert {
position: absolute;
z-index: 20;
width: 160rpx;
height: 160rpx;
left: 50%;
top: 50%;
margin-left: -80rpx;
margin-top: -80rpx;
border-radius: 80rpx;
text-align: center;
line-height: 160rpx;
font-size: 70rpx;
color: #fff;
background-color: rgba(0, 0, 0, 0.5);
}
/* 添加收货地址 */
.btn {
position: fixed;
bottom: 0rpx;
width: 100%;
height: 100rpx;
line-height: 100rpx;
background-color: white;
padding-top: 10rpx;
}
.address_push {
width: 90%;
height: 80rpx;
margin: 0 auto;
background: #FCD202;
border-radius: 20rpx;
color: white;
text-align: center;
line-height: 80rpx;
font-size: 35rpx;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

518
pages/index/shop/im.vue Normal file
View File

@@ -0,0 +1,518 @@
<template>
<view>
<view style="width: 100%;padding-bottom: 140rpx;">
<view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index'>
<view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
{{item.createTime}}
</view>
<view v-if="!item.shopId && !item.riderId" style="width: 83%;margin-left: 15%;">
<view class="chat-listitem" style="float: right;">
<view v-if="item.content && item.messageType === 1" @longpress="copy(item.content)"
class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
:src="item.content" style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
<view>
<image v-if="item.avatar" :src="item.avatar" class="chat-listitem-image"></image>
<image v-else src="../../../static/logo.png" class="chat-listitem-image"></image>
</view>
</view>
</view>
<view v-if="item.riderId" style="width: 83%;margin-right: 15%;">
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
<view v-if="item.riderId">
<image :src="item.riderAvatar" class="chat-listitem-image"></image>
</view>
<view v-if="item.content && item.messageType === 1" class="chat-listitem-text"
style="margin-left: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
:src="item.content" style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
</view>
</view>
<view v-if="item.shopId" style="width: 83%;margin-right: 15%;">
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
<view v-if="item.shopId">
<image :src="item.shopCover" class="chat-listitem-image"></image>
</view>
<view v-if="item.content && item.messageType === 1" class="chat-listitem-text"
style="margin-left: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
:src="item.content" style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
</view>
</view>
</view>
</view>
<!-- 底部聊天输入框 -->
<view class="input-box ">
<view class="justify-between padding-lr align-center"
style="display: flex;width: 100%;background-color: #EEEEEE;">
<image src="../../../static/images/msg/add.png" @click="chooseImage(['album'])"
style="width: 50rpx;height: 50rpx;margin-right: 12rpx;border-radius: 52upx;"></image>
<input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
style="width: 72%;height: 70rpx;background: #fff;margin: 0 10rpx;border-radius: 5rpx;padding-left: 10rpx;" />
<view class="save" @tap='setChatSave(1)'>发送</view>
</view>
</view>
</view>
</template>
<script>
import configdata from '../../../common/config.js';
export default {
data() {
return {
connected: false,
connecting: false,
msg: false,
type4: [],
listRight: {
chat: {
userHead: ""
},
content: "",
sendType: 1,
type: 1
},
content: '',
chatId: '',
type: 1,
ListItem: [],
ShopState: false,
ShopordersId: '',
Shopimage: '',
Shopmoney: '',
ShopTitle: '',
orderState: false,
ordersId: '',
userId: '',
orderimage: '',
orderNum: '',
teamId: '',
hand: 1,
index: 0,
page: 0,
size: 1000,
countDown: '',
ordersId: '',
byUserId: '',
RiderUnreadCount: 0,
};
},
computed: {
showMsg() {
if (this.connected) {
if (this.msg) {
return '收到消息:' + this.msg
} else {
return '等待接收消息'
}
} else {
return '尚未连接'
}
}
},
onUnload() {
// uni.closeSocket()
uni.hideLoading()
},
onLoad(d) {
this.userId = this.$queue.getData('userId');
this.byUserId = d.byUserId
this.ordersId = d.ordersId;
this.connect();
// if (d.teamName) {
// uni.setNavigationBarTitle({
// title: d.teamName
// });
// }
},
onShow() {
if (this.connected || this.connecting) {
} else {
this.connect();
}
},
onHide() {
// uni.closeSocket()
},
onUnload() {
this.close()
},
methods: {
copy(content) {
uni.showModal({
title: '温馨提示',
content: '确认要复制此文字吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
uni.setClipboardData({
data: content,
success: r => {
this.$queue.showToast('复制成功');
}
});
}
}
});
},
getDateDiff(data) {
// 传进来的data必须是日期格式不能是时间戳
//var str = data;
//将字符串转换成时间格式
var timePublish = new Date(data);
var timeNow = new Date();
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var month = day * 30;
var result = "2";
var diffValue = timeNow - timePublish;
var diffMonth = diffValue / month;
var diffWeek = diffValue / (7 * day);
var diffDay = diffValue / day;
var diffHour = diffValue / hour;
var diffMinute = diffValue / minute;
if (diffMonth > 3) {
result = timePublish.getFullYear() + "-";
result += timePublish.getMonth() + "-";
result += timePublish.getDate();
} else if (diffMonth > 1) { //月
result = data.substring(0, 10);
} else if (diffWeek > 1) { //周
result = data.substring(0, 10);
} else if (diffDay > 1) { //天
result = data.substring(0, 10);
} else if (diffHour > 1) { //小时
result = parseInt(diffHour) + "小时前";
} else if (diffMinute > 1) { //分钟
result = parseInt(diffMinute) + "分钟前";
} else {
result = "刚刚";
}
return result;
},
connect() {
let that = this;
let userId = that.$queue.getData('userId');
if (that.connected || that.connecting) {
uni.showModal({
content: '正在连接或者已经连接,请勿重复连接',
showCancel: false
})
return false
}
that.connecting = true
uni.showLoading({
title: '连接中...'
})
console.log(userId, '*******************')
console.log(this.config("WSHOST1") +'/'+ this.ordersId, '*******************2')
uni.connectSocket({
// url: 'ws://192.168.1.17:8881/gameTeamChat/' + userId + '_' + this.teamId,
// url: 'wss://game.shengqianxiong.com.cn/wss/gameTeamChat/' + userId + '_' + this.teamId,
// url: 'ws://192.168.1.17:8180/sqx_fast/chatSocket/' + userId,
url: this.config("WSHOST1") + this.ordersId,
data() {
return {
msg: 'Hello'
}
},
header: {
'content-type': 'application/json'
},
method: 'GET',
success(res) {
uni.hideLoading();
that.getTimeOrListItem1();
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
},
fail(err) {
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
console.log("--------------" + JSON.stringify(err))
}
});
uni.onSocketOpen((res) => {
that.connecting = false
that.connected = true
uni.hideLoading()
// uni.showToast({
// icon: 'none',
// title: '连接成功'
// })
console.log('onOpen', res);
});
uni.onSocketError((err) => {
that.connecting = false
that.connected = false
uni.hideLoading()
uni.showModal({
content: '网络较差,请稍后再试',
showCancel: false
})
console.log('onError', err);
});
uni.onSocketMessage(function(res) {
console.log('收到服务器内容1111' + JSON.stringify(res));
setTimeout(() => {
that.getTimeOrListItem1();
}, 50);
});
uni.onSocketClose((res) => {
that.connected = false
that.startRecive = false
that.msg = false
console.log('onClose', res)
});
},
close() {
uni.closeSocket()
},
getTimeOrListItem1() {
this.$Request.getMsg('/app/ordersChat/selectGameChatDetails?type=1&page=1&limit=1000&ordersId=' + this.ordersId)
.then(
res => {
this.ListItem = [];
if (res.data) {
var time = '';
res.data.list.forEach(d => {
if (!d.avatar) {
// d.chat.userHead = '../../static/logo.png';
let avatar = this.$queue.getData('avatar');
d.avatar = avatar
}
this.ListItem.push(d);
});
this.ListItem = this.ListItem.reverse();
setTimeout(() => {
uni.pageScrollTo({
scrollTop: 99999,
duration: 0
});
}, 50);
}
uni.hideLoading();
});
},
getChatSave() {
let userId = this.$queue.getData('userId');
let phone = this.$queue.getData('phone');
let userName = this.$queue.getData('userName');
if (!phone) {
phone = this.$queue.getData('userName');
}
let avatar = this.$queue.getData('avatar');
let data = {
userId: userId,
userHead: avatar,
userName: userName,
storeId: '0',
storeHead: '同城外卖',
storeName: ''
}
this.$Request.postJson('/chat/save', data).then(res => {
if (res.status === 0) {
this.chatId = res.data.chatId;
uni.showLoading({
title: '加载中...'
});
this.getTimeOrListItem1();
}
});
},
setChatSave(type) {
//type:1文字 2图片
if (type === 1 && this.content == '') {
this.$queue.showToast('请输入聊天内容');
return;
}
// if (this.chatId == '' || this.chatId == undefined) {
// this.$queue.showToast('网络较差,请稍后再试');
// return;
// }
let userId = this.$queue.getData('userId');
let avatar = this.$queue.getData('avatar');
let phone = this.$queue.getData('phone');
let userName = this.$queue.getData('userName');
if (!phone) {
phone = this.$queue.getData('userName');
}
console.log(this.byUserId)
let data = {
content: this.content,
messageType: type,
userId: userId,
ordersId: this.ordersId,
}
data = JSON.stringify(data);
let that = this;
uni.sendSocketMessage({
data: data,
success(res) {
let avatar = that.$queue.getData('avatar');
if (!avatar) {
avatar = '../../static/logo.png';
}
let data = {
chat: {
userHead: avatar
},
content: that.content,
type: type,
userId: userId
}
console.log(data, 'data99999999999999999')
setTimeout(() => {
that.getTimeOrListItem1();
}, 50);
console.log(that.content);
},
fail(err) {
console.log(err);
}
})
this.content = '';
},
//发送图片
chooseImage(sourceType) {
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
this.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
console.log(uploadFileRes)
this.content = JSON.parse(uploadFileRes.data).data;
this.setChatSave(2);
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
//查看大图
viewImg(item) {
let imgsArray = [];
imgsArray[0] = item;
uni.previewImage({
current: 0,
urls: imgsArray
});
},
},
};
</script>
<style>
page {
/* background: #1c1b20; */
}
.input-box {
position: fixed;
bottom: 0;
left: 0;
height: 120rpx;
width: 100%;
display: flex;
box-sizing: content-box;
z-index: 999;
/* background-color: #ececec; */
/* padding: 0 5rpx; */
}
.chat-listitem {
display: flex;
margin-top: 20rpx;
padding: 10rpx;
}
.chat-listitem-text {
color: #000000;
background: #FFFFFF;
margin-top: 10rpx;
width: fit-content;
padding: 15rpx;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-radius: 10rpx;
}
.chat-listitem-image-type4 {
color: #000000;
background: #FFFFFF;
width: fit-content;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
.chat-listitem-image {
margin-top: 5rpx;
width: 75rpx;
height: 75rpx;
border-radius: 5rpx;
}
.save {
width: 130rpx;
text-align: center;
border-radius: 70rpx;
height: 70rpx;
color: #FFF;
background: #1789FD;
margin: 5rpx 10rpx 0;
line-height: 70rpx;
}
</style>

1921
pages/index/shop/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
<template>
<view class="">
<!-- <view v-if="msgList.length" class="margin-topW">
<view class="flex padding-tb radius padding-lr-sm bg" @click="goMsg" v-for="(item,index) in msgList"
:key='index'>
<view>
<image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
src="../../static/images/msg/msg.png"></image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view class="text-white">{{item.title?item.title: '系统消息'}}</view>
<view v-if="messageCount>0"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{messageCount}}</view>
</view>
<view>
<view class="text-grey">{{item.content}}</view>
</view>
</view>
</view>
</view> -->
<view v-if="chatList.length" class="content ">
<view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)"
v-for="(item,index) in chatList" :key='index'>
<view class="flex padding-tb " v-if="userId == item.userId">
<view>
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view class="text-white">{{item.shopName}}</view>
<view class="text-grey">{{item.createTime}}</view>
</view>
<view class="flex justify-between">
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
<view v-if="item.unreadMessageCount"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{item.unreadMessageCount}}</view>
</view>
</view>
</view>
<view class="flex padding-tb" v-else>
<view>
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view class="text-white">{{item.shopName}}</view>
<view class="text-grey">{{item.createTime}}</view>
</view>
<view class="flex justify-between">
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
<view v-if="item.unreadMessageCount"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{item.unreadMessageCount}}</view>
</view>
</view>
</view>
</view>
</view>
<empty v-if="!chatList.length && !msgList.length" content='暂无消息'></empty>
</view>
</template>
<script>
import empty from '../../components/empty.vue'
export default {
components: {
empty
},
data() {
return {
page: 1,
limit: 100,
chatList: [],
userId: '',
msgList: [],
time: '',
messageCount: 0
}
},
onLoad() {
this.getChatList()
},
onShow() {
let that = this
that.userId = uni.getStorageSync('userId')
if (that.userId) {
that.time = setInterval(function() {
that.getChatList()
// that.getMsgList()
that.$nextTick(function() {
that.messageCount = uni.getStorageSync('messageCount')
})
}, 10000)
} else {
that.chatList = []
that.msgList = []
}
},
onHide() {
clearInterval(this.time)
},
methods: {
getChatList() {
this.$Request.get("/shop/ordersChat/selectOrdersChatPageShop", {
page: this.page,
limit: this.limit,
shopId: uni.getStorageSync('shopId')
}).then(res => {
if (res.code == 0) {
this.chatList = res.data.list
}
});
},
// getMsgList() {
// this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
// if (res.code == 0) {
// this.msgList = res.data.list
// }
// });
// },
goIM(e) {
let userId = this.$queue.getData('userId');
if (e.userId == userId) {
userId = e.byUserId
} else {
userId = e.userId
}
uni.navigateTo({
url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId
})
},
goMsg() {
uni.navigateTo({
url: '/pages/msg/message'
})
}
}
}
</script>
<style>
page {
background-color: #F7F7F7;
}
.bg {
background: #FFFFFF;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,566 @@
<template>
<view v-if="XCXIsSelect=='是'">
<view style="position: fixed;top: 0;width: 100%;z-index: 999;">
<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="hd flex justify-center" style="position: fixed;top: 90rpx;" v-if="hdlist.length>0">
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="hd flex justify-center" style="position: fixed;top: 90rpx;" v-if="hdlist.length>0">
<!-- #endif -->
<view class="hd-box">
<scroll-view scroll-x="true" class="scroll-view_H">
<view class="hd-box-item" :style="currenthd==index?'background-color:#fcd202;font-weight:bold':''" @click="searchhd(index,item.activityId)" v-for="(item,index) in hdlist" :key="index">{{item.activityTitle}}</view>
</scroll-view>
</view>
</view>
<!-- #ifdef H5 -->
<view class="padding-lr-sm" style="margin-top: 80rpx;">
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="padding-lr-sm" style="margin-top: 180rpx;">
<!-- #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 {
currenthd:-1,
hdlist:[],
activityId:'',
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:''
}
},
onLoad(e) {
console.log(e)
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
if (this.XCXIsSelect == '否') {
this.getGuize()
uni.setNavigationBarTitle({
title: '隐私政策'
});
} else {
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()
that.gethdlist();
},
methods: {
//筛选活动
searchhd(index,activityId){
if(index==this.currenthd){
this.currenthd = -1
this.activityId = '';
this.getShopList()
}else{
this.currenthd = index;
this.activityId=activityId;
this.getShopList()
}
},
//获取所有活动
gethdlist(){
this.$Request.get("/app/activityManage/getActivityList").then(res => {
if (res.code == 0) {
res.data.records.map((item,index)=>{
if(item.activityId==14){
res.data.records.splice(index, 1)
}
})
this.hdlist = res.data.records
}
});
},
// 跳转商品详情
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'
})
},
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(e, '当前店铺')
// let myDate = new Date();
// let hours = myDate.getHours();
// let minute = myDate.getMinutes();
// let openTime = this.shop.businessHours.split(':')[0] //开始小时
// let closeTime = this.shop.lockHours.split(':')[0] //结束小时
// let openTime1 = this.shop.businessHours.split(':')[1] //开始分钟
// let closeTime1 = this.shop.lockHours.split(':')[1] //结束分钟.
// console.log(hours)
// console.log(minute)
// console.log(openTime)
// console.log(openTime1)
// console.log(closeTime)
// console.log(closeTime1)
// console.log(minute >= closeTime1)
// if (hours < openTime) {
// this.hintShow = true
// return
// } else if (hours == openTime && minute < openTime1) {
// this.hintShow = true
// return
// } else if (hours >= closeTime) {
// this.hintShow = true
// return
// } else if (hours == closeTime && minute >= closeTime1) {
// this.hintShow = true
// return
// }
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">
.hd{
width: 100%;
height: auto;
background-color: rgb(248, 248, 248);
padding: 20rpx 0 20rpx 0;
z-index: 1;
// margin-top: 20rpx;
.hd-box{
width: 686rpx;
height: 100%;
.scroll-view_H{
width: 100%;
white-space: nowrap;
}
.hd-box-item{
display: inline-block;
padding: 10rpx 20rpx 10rpx 20rpx;
background-color: #ffffff;
font-size: 24rpx;
border-radius: 8rpx;
margin-right: 10rpx;
}
}
}
.select {
color: #FCD202;
}
.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>

16
pages/index/webView.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: null //要打开的外部链接
}
},
onLoad: function (option) {
this.url = option.url
}
}
</script>

726
pages/my/index.vue Normal file
View File

@@ -0,0 +1,726 @@
<template>
<view class="content">
<view class="head">
<view class="head_image">
<!-- #ifdef MP-WEIXIN -->
<button open-type="chooseAvatar" v-if="token" @chooseavatar="onChooseAvatar">
<image style="width: 90rpx;height: 90rpx;border-radius: 50%"
:src="avatar?avatar:'../../static/logo.png'"></image>
</button>
<image v-if="!token" @click="bindlogin" style="width: 90rpx;height: 90rpx;border-radius: 50%"
src="../../static/logo.png"></image>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<image @click="avatar?goLogin():''" style="width: 90rpx;height: 90rpx;border-radius: 50%"
:src="avatar?avatar:'../../static/logo.png'"></image>
<!-- #endif -->
<view class="lovip" v-if="isVip">
<image src="../../static/images/my/vip.png" style="width: 88rpx;height: 32rpx;top: -30rpx;"></image>
</view>
</view>
<view class="head_name">
<view class="name" v-if="token" @click="goShop('/pages/my/updateNickName')">{{ userName }}</view>
<view class="name" v-if="!token" @click="bindlogin">登录</view>
</view>
</view>
<view class="margin-lr padding-lr-sm padding-tb radius flex justify-between" v-if="XCXIsSelect=='是'">
<view class="text-center text-black" @click="goShop('/my/coupon/index')">
<view class="text-lg text-bold">{{msgData.countCoupon}}</view>
<view>外卖优惠券</view>
</view>
<view class="text-center text-black" @click="goShop('/my/wallet/index')">
<view class="text-lg text-bold">{{msgData.userMoney}}</view>
<view>我的余额</view>
</view>
<view class="text-center text-black" @click="goShop('/my/task/index')">
<view class="text-lg text-bold">{{msgData.userIntegral}}</view>
<view>我的积分</view>
</view>
</view>
<view class="margin-bottom padding-lr" style="position: relative;" v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/bg.png" style="width: 100%;height: 110rpx;" mode=""></image>
<view class="flex justify-between margin-lr padding-tb-sm radius"
style="position: absolute;top: 0;width: 640rpx;">
<image src="../../static/images/my/huiyuan.png" style="width: 70rpx;height: 70rpx;"></image>
<view class="flex-sub margin-left text-lg text-bold" style="line-height: 74rpx;color: #604320;">
超级会员享特权
</view>
<view v-if="!isVip" class="btn-bg" style="color: #604320;" @click="goNav({url:'/my/vip/index'})">去开通
</view>
<view v-if="isVip" class="btn-bg" style="color: #604320;" @click="goNav({url:'/my/vip/index'})">已开通
</view>
</view>
</view>
<view class="center flex justify-between bg-white margin-top padding-lr padding-tb-lg radius">
<view class="flex justify-between flex-sub padding-right" style="border-right: 2rpx solid #CCCCCC;"
@click="goShop('/my/task/index')">
<view class="">
<view class="text-black text-xl text-bold">每日任务</view>
<view class="text-sm margin-top-xs">每日签到领积分</view>
</view>
<image src="../../static/images/my/renwu.png" mode="" style="width: 88rpx;height: 88rpx;"></image>
</view>
<view class="flex justify-between flex-sub padding-left" @click="goShop('/my/integral/index')">
<view class="">
<view class="text-black text-xl text-bold">积分商城</view>
<view class="text-sm margin-top-xs flex align-center">积分兑换优惠券</view>
</view>
<image src="../../static/images/my/jifen.png" mode="" style="width: 88rpx;height: 88rpx;"></image>
</view>
</view>
<view class="margin padding-lr-sm padding-tb bg-white radius">
<view class="flex justify-between align-center">
<view class="text-lg text-bold text-black">推荐工具</view>
</view>
<view class="flex flex-wrap">
<!-- #ifdef MP-WEIXIN -->
<view class="text-center margin-tb-sm" style="width: 25%;" v-if="XCXIsSelect=='是'">
<button class="btn" open-type="share">
<image src="../../static/images/my/4.png" style="width: 50rpx;height: 48rpx;" mode=""></image>
<view>分享好友</view>
</button>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goApplet(shopAppId)"
v-if="shopStatus == 1&&XCXIsSelect=='是'">
<image src="../../static/images/my/1.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">商家入驻</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/apply/index'})"
v-if="shopStatus != 1&&XCXIsSelect=='是'">
<image src="../../static/images/my/1.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">商家入驻</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goApplet(qishouAppId)"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/11.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">骑手入驻</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/apply/index'})"
v-if="shopStatus != 1">
<image src="../../static/images/my/1.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">商家入驻</view>
</view>
<!-- #ifdef APP -->
<view class="text-center margin-tb-sm" style="width: 25%;" @click="shopRuzhu" v-else>
<image src="../../static/images/my/1.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">商家入驻</view>
</view>
<!-- #endif -->
<!-- #endif -->
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/tousu/index'})"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/order/tousu.png" style="width: 55rpx;height: 55rpx;"
mode="scaleToFill"></image>
<view class="text-sm">我的投诉</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;"
@click="goNav({url:'/my/myPingJia/myPingJia'})" v-if="XCXIsSelect=='是'">
<image src="../../static/images/order/pingjia.png" style="width: 55rpx;height: 55rpx;"
mode="scaleToFill"></image>
<view class="text-sm">我的评价</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/helpList/index'})">
<image src="../../static/images/my/12.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">帮助中心</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/msg/index'})"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/3.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">消息中心</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/running/index/index'})"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/5.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">同城跑腿</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/setting/chat'})"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/6.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">联系客服</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/address/index'})">
<image src="../../static/images/my/7.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">地址管理</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/hongbao/hongbao'})"
v-if="XCXIsSelect=='是'">
<image src="../../static/images/my/9.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">跑腿红包</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;position: relative;"
@click="goNav({url:'/my/chat/index'})" v-if="XCXIsSelect=='是'">
<image src="../../static/images/order/kefu.png" style="width: 55rpx;height: 55rpx;"
mode="scaleToFill">
</image>
<view class="text-sm">聊天室</view>
<view v-if="messageCount>0"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;position: absolute;top:-10rpx;right: 24rpx;">
{{messageCount}}
</view>
</view>
<view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/setting/index'})">
<image src="../../static/images/my/8.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
</image>
<view class="text-sm">系统设置</view>
</view>
</view>
</view>
</view>
</template>
<script>
import config from '../../common/config.js'
export default {
data() {
return {
messageCount: 0,
avatar: '',
userName: '',
checkCertification: -1,
arr: [],
showModal: true,
msgData: {
userIntegral: 0,
countCoupon: 0,
userMoney: 0
},
tuiguang: '',
tuiguangImg: '',
token: '',
XCXIsSelect: '否',
shopStatus: '',
isVip: false,
messageCount: 0,
time: '',
qishouAppId: '', //骑手APPID
shopAppId: '', //商户appid
}
},
onLoad() {
let that = this
that.token = that.$queue.getData("token")
that.$Request.get('/app/common/type/248').then(res => { //跑腿师傅端微信小程序APPID 248
if (res.code == 0) {
that.qishouAppId = res.data.value
}
});
that.$Request.get('/app/common/type/305').then(res => { //商户端微信小程序APPID 305
if (res.code == 0) {
that.shopAppId = res.data.value
}
});
that.XCXIsSelect = that.$queue.getData('XCXIsSelect') ? that.$queue.getData('XCXIsSelect') : '是'
that.time = setInterval(function() {
that.messageCount = uni.getStorageSync('messageCount')
if (that.messageCount) {
that.messageCount = that.messageCount
} else {
that.messageCount = 0
}
}, 3000)
that.getZiZhi()
console.log("that.XCXIsSelect___:" + that.XCXIsSelect)
},
onHide() {
clearInterval(this.time)
},
onShow() {
let that = this
// this.avatar = this.$queue.getData('avatar') || '';
// this.userName = this.$queue.getData('userName') || '';
that.token = that.$queue.getData("token")
if (that.token) {
that.getUserInfo();
that.getMsgData()
that.messageCount = uni.getStorageSync('messageCount')
if (that.messageCount) {
that.messageCount = that.messageCount
} else {
that.messageCount = 0
}
} else {
that.token = '';
that.isVip = false
that.userName = ''
that.avatar = ''
that.msgData.userIntegral = 0
that.msgData.countCoupon = 0
that.msgData.userMoney = 0
}
},
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: {
//微信填写能力获取头像
onChooseAvatar(e) {
console.log(e.detail.avatarUrl)
let that = this;
let token = uni.getStorageSync('token');
uni.showLoading({
title: '上传中...'
});
uni.uploadFile({
// url: config.APIHOST1 + '/alioss/upload', //仅为示例,非真实的接口地址
url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload', //仅为示例,非真实的接口地址
filePath: e.detail.avatarUrl,
header: {
token: token
},
name: 'file',
success: uploadFileRes => {
let url = JSON.parse(uploadFileRes.data).data;
that.$Request.postJson(
'/app/user/updateUserImageUrl?avatar=' + url).then(
res => {
uni.hideLoading();
if (res.code === 0) {
that.$queue.showToast(
"更新成功");
that.getUserInfo();
}
});
}
});
},
goLogin() {
let that = this;
var url = null;
let userId = this.$queue.getData('userId');
if (!userId) {
this.bindlogin();
return;
}
uni.showActionSheet({
// itemList按钮的文字接受的是数组
itemList: ["查看头像", "从相册选择图片"],
success(e) {
var index = e.tapIndex
if (index === 0) {
// 用户点击了预览当前图片
// 可以自己实现当前头像链接的读取
let url = that.avatar;
let arr = []
arr.push(url)
uni.previewImage({
// 预览功能图片也必须是数组的
urls: arr
})
} else if (index === 1) {
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function(res) {
uni.showLoading({
title: '上传中...'
});
let token = uni.getStorageSync('token');
uni.uploadFile({
// url: config.APIHOST1 + '/alioss/upload', //仅为示例,非真实的接口地址
url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload', //仅为示例,非真实的接口地址
filePath: res.tempFilePaths[0],
header: {
token: token
},
name: 'file',
success: uploadFileRes => {
url = JSON.parse(uploadFileRes.data).data;
that.$Request.postJson(
'/app/user/updateUserImageUrl?avatar=' +
url).then(
res => {
uni.hideLoading();
if (res.code === 0) {
that.$queue.showToast(
"更新成功");
that.getUserInfo();
}
});
}
});
}
});
}
}
})
},
shopRuzhu() {
uni.showToast({
title: '请先下载同城外卖商户端APP',
icon: 'none'
})
},
getMsgData() {
this.$Request.get("/app/userintegral/findUserMessage").then(res => {
if (res.code == 0) {
this.msgData = res.data
}
});
},
// 分享文案和图片
getZiZhi() {
this.$Request.getT('/app/common/type/239').then(res => {
if (res.code === 0) {
this.tuiguang = res.data.value;
}
});
this.$Request.getT('/app/common/type/238').then(res => {
if (res.code === 0) {
this.tuiguangImg = res.data.value;
}
});
},
goSwt(e) {
uni.setStorageSync('current', e)
setTimeout(function() {
uni.switchTab({
url: '/pages/order/index',
})
}, 10)
},
goApplet(e) {
uni.navigateToMiniProgram({
appId: e,
path: 'pages/index/index',
success(res) {
// 打开成功
}
})
},
goNav(e) {
if (this.token) {
if (e.name == '注册骑手') {
uni.navigateToMiniProgram({
appId: 'wx5ed22ce813e47796',
path: '/pages/login/login',
extraData: {
'data1': 'test'
},
success(res) {
// 打开成功
console.log("打开成功")
}
})
} else if (e.name == '分享好友') {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 1,
summary: "我正在使用HBuilderX开发uni-app赶紧跟我一起来体验",
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
} else {
uni.navigateTo({
url: e.url
})
}
} else {
this.bindlogin();
}
},
goShop(url) {
if (this.token) {
uni.navigateTo({
url
})
} else {
this.bindlogin();
}
},
getUserInfo() {
this.$Request.getT('/app/user/selectUserMessage').then(res => {
console.log(res)
if (res.code == 0) {
if (parseInt(res.data.checkCertification)) {
this.checkCertification = parseInt(res.data.checkCertification)
} else {
this.checkCertification = -1;
}
this.isVip = res.data.isVip
this.shopStatus = res.data.shopStatus
this.$queue.setData("avatar", res.data.avatar ? res.data.avatar :
'../../static/logo.png');
this.$queue.setData("userId", res.data.userId);
this.$queue.setData("phone", res.data.phone);
this.$queue.setData("status", res.data.status);
this.$queue.setData("userName", res.data.userName ? res.data.userName : res
.data.nickName);
this.avatar = res.data.avatar ? res.data.avatar : '../../static/logo.png';
this.userName = res.data.userName ? res.data.userName : res.data.nickName
}
});
},
bindlogin() {
if (!this.token) {
uni.navigateTo({
url: '/pages/public/login'
})
}
},
bindTo(name) {
console.log(name)
if (this.token) {
if (name == '我的红包') {
uni.navigateTo({
url: '/pages/my/hongbao/hongbao'
})
} else if (name == '注册骑手') {
uni.navigateToMiniProgram({
appId: 'wx5ed22ce813e47796',
path: '/pages/index/index',
extraData: {
'data1': 'test'
},
success(res) {
// 打开成功
console.log("打开成功")
}
})
} else if (name == '意见反馈') {
uni.navigateTo({
url: '/pageA/feedback/feedback'
})
} else if (name == '联系客服') {
uni.navigateTo({
url: '/pageA/kefu/kefu'
})
} else if (name == '系统设置') {
uni.navigateTo({
url: '/pages/my/set/set'
})
} else if (name == '地址管理') {
uni.navigateTo({
url: '/pageA/address/address'
})
}
} else {
this.bindlogin();
}
},
bindapprove() {
if (this.token) {
uni.navigateTo({
url: '/pages/my/approve/approve'
})
} else {
this.bindlogin();
}
},
binduser() {
if (this.token) {
// uni.navigateTo({
// url: '/pages/my/userphone/userphone'
// })
} else {
this.bindlogin();
}
}
}
}
</script>
<style>
button::after {
border: none;
background-color: none;
}
button {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
padding-left: 0px;
padding-right: 0px;
box-sizing: border-box;
text-decoration: none;
line-height: 1.35;
overflow: hidden;
color: #666666;
/* background-color: #fff; */
background-color: rgba(255, 255, 255, 0) !important;
width: 100%;
height: 100%;
}
.btn-bg {
width: 64px;
height: 28px;
background: linear-gradient(90deg, #CDA26E 0%, #DCB78A 100%);
border-radius: 28px;
text-align: center;
line-height: 28px;
margin-top: 10upx;
color: '#604320'
}
body {
background: #F5F5F5;
}
/* #ifndef MP-WEIXIN */
page {
background: #F2EDED;
}
/* #endif */
.content {
width: 100%;
}
.btn {
font-size: 24upx;
/* width: 95%; */
text-align: center;
background: #FFFFFF;
margin-top: 6rpx;
}
.head {
/* width: 100%; */
/* height: 200rpx; */
display: flex;
align-items: center;
padding: 30rpx;
border-radius: 16rpx;
background-image: linear-gradient(#FEFBDA, #F7F7F7);
}
.head_image {}
.head_image>image {
width: 90rpx;
height: 90rpx;
border-radius: 50%
}
.head_name {
margin-left: 10rpx;
}
.name {
font-size: 38rpx;
font-weight: bold;
}
.approve {
position: absolute;
top: 100rpx;
font-size: 24rpx;
color: #999999;
}
/* 列表 */
.use_list {
width: 100%;
background: #ffffff;
margin-top: 20rpx;
}
.list_box {
width: 90%;
margin: 0 auto;
display: flex;
height: 110rpx;
}
.box_left {
flex: 1;
display: flex;
justify-content: left;
align-items: center;
}
.box_right {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
color: #808080;
}
.use_name {
margin-left: 30rpx;
font-size: 32rpx;
}
.use_image image {
width: 50rpx;
height: 50rpx;
}
.center {
width: 94%;
/* line-height: 1.5; */
background-color: #FFFFFF;
border-radius: 18rpx;
margin: 0 auto 0;
display: flex;
justify-content: space-between;
}
.header_text2 {
font-size: 24rpx;
font-weight: 500;
color: #999999;
margin-top: 10rpx;
}
.header_text4 {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
</style>

197
pages/my/updateNickName.vue Normal file
View File

@@ -0,0 +1,197 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">原昵称</text>
<input type="text" :value="oldnickName" placeholder-class="input-empty" disabled="true" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">新昵称</text>
<input type="nickname" v-model="nickName" placeholder="请设置新昵称" placeholder-class="input-empty" maxlength="20"
minlength="6" />
</view>
</view>
<button class="confirm-btn" @click="updatNickName">修改昵称</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
nickName: '',
oldnickName: ''
}
},
onLoad() {
this.oldnickName = this.$queue.getData('userName');
},
methods: {
updatNickName() {
var patrn = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、 ]/im;
if (patrn.test(this.nickName)) { // 如果包含特殊字符返回false
this.$queue.showToast('包含特殊字符,请重新输入');
return;
}
uni.showLoading({
title: '提交中...'
});
let userId = this.$queue.getData('userId');
let data = {
userName:this.nickName
}
this.$Request.postT('/app/user/updateUserName',data).then(res => {
uni.hideLoading();
if (res.code === 0) {
this.$queue.showToast("更新成功");
setTimeout(() => {
uni.navigateBack();
}, 500);
}
});
},
},
}
</script>
<style lang='scss'>
page {
background: #fff;
}
.send-msg {
border-radius: 30px;
color: white;
height: 30px;
font-size: 14px;
line-height: 30px;
background: #e10a07;
}
.container {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #fff;
}
.wrapper {
position: relative;
z-index: 90;
background: #fff;
padding-bottom: 20px;
}
.right-top-sign {
position: absolute;
top: 40px;
right: -15px;
z-index: 95;
&:before,
&:after {
display: block;
content: "";
width: 20px;
height: 40px;
background: -moz-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
background: -webkit-gradient(linear,
left top,
left right,
color-stop(0, #fa4dbe),
color-stop(100%, #fbaa58));
background: -webkit-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
background: -o-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
background: -ms-linear-gradient(left, #fa4dbe 0, #fbaa58 100%);
background: linear-gradient(to left, #fa4dbe 0, #fbaa58 100%);
}
&:before {
transform: rotate(50deg);
border-radius: 0 50px 0 0;
}
&:after {
position: absolute;
right: -198px;
top: 0;
transform: rotate(-50deg);
border-radius: 50px 0 0 0;
/* background: pink; */
}
}
.left-bottom-sign {
position: absolute;
left: -270px;
bottom: -320px;
/*border: 100upx solid #d0d1fd;*/
border-radius: 50%;
padding: 90px;
}
.welcome {
position: relative;
left: 30px;
top: -55px;
font-size: 28px;
color: #555;
text-shadow: 1px 0px 1px rgba(0, 0, 0, .3);
}
.input-content {
padding: 0 20px;
}
.confirm-btn {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
background: #fcd202;
color: #fff;
&:after {
border-radius: 60px;
}
}
.confirm-btn1 {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
background: whitesmoke;
color: grey;
&:after {
border-radius: 60px;
}
}
.forget-section {
text-align: center;
margin-top: 40px;
}
.register-section {
position: fixed;
left: 0;
bottom: 30px;
width: 100%;
text-align: center;
text {
margin-left: 10px;
}
}
</style>

View File

@@ -0,0 +1,188 @@
<template>
<view class="content">
<view class="online_box">
<view class="part1">
<view class="online_left">投诉类型</view>
<view class="online_right" @click="show = true">
{{complaintName?complaintName:'请选择投诉类型'}}
<image src="../../../static/images/index/right.png"></image>
</view>
</view>
<u-line color="#E6E6E6" />
<view class="online">
<view class="tit">投诉理由</view>
<view class="text_box" style="margin-top: 20rpx;">
<u-input v-model="value" height="300" :type="type" :border="border" :clearable="false"
placeholder="请描述问题发生的情况" />
</view>
</view>
</view>
<view class="btn" @click="bindorder">立即提交</view>
<u-picker v-model="show" mode="selector" :range="typeList" range-key="illegal" @confirm='select'></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
value: '',
type: 'textarea',
border: true,
indentNumber: '',
complaintName: '',
typeList: [],
IllegalId: '',
indentType: ''
}
},
onLoad(options) {
console.log(options)
this.indentNumber = options.indentNumber
this.indentType = options.indentType
this.getTypeList()
},
methods: {
select(e) {
console.log(e)
this.complaintName = this.typeList[e].illegal
this.IllegalId = this.typeList[e].id
},
getTypeList() {
this.$Request.get('/shop/illegalType/selectIllegalTypeList').then(res => {
if (res.code == 0) {
this.typeList = res.data
}
});
},
bindorder() {
if (this.IllegalId == '') {
uni.showToast({
title: '请选择投诉类型',
icon: 'none'
})
return
}
if (this.value == '') {
uni.showToast({
title: '请填写投诉原因',
icon: 'none'
})
return
}
this.$Request.postJson('/app/tbindent/insertComplaint', {
indentNumber: this.indentNumber,
wrongExplain: this.value,
illegalId: this.IllegalId,
indentType: '5',
type: '1',
userId: uni.getStorageSync('userId')
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
console.log('失败:', res.data)
}
});
}
}
}
</script>
<style>
body {
background-color: #F5F5F5;
}
.content {
width: 100%;
}
.online_box {
width: 90%;
margin: 0 auto;
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 30rpx;
padding-bottom: 40rpx;
}
.part1 {
width: 90%;
margin: 0 auto;
height: 80rpx;
display: flex;
align-items: center;
}
.online_left {
flex: 1;
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
}
.online_right {
color: #999999;
font-size: 22rpx;
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
}
.online_right image {
width: 12rpx;
height: 21rpx;
margin-left: 10rpx;
}
.online_title {
font-size: 28rpx;
font-weight: bold;
letter-spacing: 2rpx;
width: 90%;
margin: 0 auto;
line-height: 80rpx;
}
.online {
width: 90%;
margin: 0 auto;
padding-bottom: 34rpx;
}
.tit {
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
margin-top: 19rpx;
}
.u-input--border {
border: none !important;
background: #F5F5F5 !important;
}
.btn {
width: 90%;
margin: 0 auto;
background: #FF7F00;
line-height: 90rpx;
text-align: center;
color: white;
border-radius: 15rpx;
margin-top: 20rpx;
font-size: 28rpx;
}
</style>

866
pages/order/detail.vue Normal file
View File

@@ -0,0 +1,866 @@
<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 == 5">待确认</view>
<view class="rider_order" v-if="orderDetails.indentState == 3">已接单</view>
<view class="rider_order" v-if="orderDetails.indentState ==4">派送中</view>
<view class="rider_order" v-if="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(orderDetails)"
v-if="orderDetails.indentState ==7||orderDetails.indentState == 6&&!orderDetails.evaluateMessage">
去评论
</view> -->
<view class="btn1" v-if="orderDetails.indentState == 0||orderDetails.indentState == 2"
@tap.stop="bindorderOff(orderDetails)">取消订单</view>
<view class="btn1" @tap.stop="bindconfirm(orderDetails)" v-if="orderDetails.indentState == 5">确认订单
</view>
<view class="btn2" @tap.stop="bindorder(orderDetails)"
v-if="orderDetails.indentState == 1||orderDetails.indentState == 3||orderDetails.indentState ==8||
orderDetails.indentState ==9||orderDetails.indentState ==10||orderDetails.indentState == 4||orderDetails.indentState == 6">再来一单</view>
<view class="btn2" v-if="orderDetails.indentState == 0" @tap.stop="bindorderpay(orderDetails)">立即付款
</view>
</view>
</view>
</view>
<!-- 购买时间 -->
<view class="five_box" style="padding: 30rpx 30rpx;">
<text>预约时间</text>
<text style="font-weight: bold;">{{orderDetails.sendOutTime?orderDetails.sendOutTime:''}}</text>
</view>
<map v-if="(orderDetails.indentState == 3||orderDetails.indentState == 4||orderDetails.indentState == 5) && latitude && longitude"
id="map" @tap="goMap" style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers"
:latitude="latitude" :longitude="longitude"></map>
<!-- 同城购买-->
<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?orderDetails.productDetails:''}}</view>
</view>
<!-- 同城服务-->
<view class="part_three" v-if="orderDetails.indentType == 4">
<view class="city_pay">
<view class="city_box">同城服务</view>
<text v-if="orderDetails.serviceType">{{orderDetails.serviceType}}</text>
</view>
<view class="pay_tit">{{orderDetails.serviceDetails?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 v-if="orderDetails.itemType">{{orderDetails.itemType}}</text>
<text v-if="orderDetails.itemValue">{{orderDetails.itemValue}}</text>
<text v-if="orderDetails.itemWeight">{{orderDetails.itemWeight}}</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/images/order/mai.png" v-if="orderDetails.indentType == 3"></image>
<image src="../../static/images/order/icon_f.png" v-else></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 class="phone_bd" @click="bindphone(0)">拨打</view> -->
</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/images/order/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 class="phone_bd" @click="bindphone()">联系TA</view> -->
</view>
</view>
</view>
</view>
<u-line color="#F2F2F2" />
<view class="address_pay">
<view class="runing_pay">
跑腿费
</view>
<view class="runing_distance">
<!-- {{orderDetails.distance}}m -->
<text>¥{{orderDetails.indentBasicsMoney?orderDetails.indentBasicsMoney:0}}</text>
</view>
</view>
</view>
<!-- 联系骑手 -->
<view class="rider_box"
v-if="orderDetails.indentState != 0&&orderDetails.indentState != 1&&orderDetails.indentState != 8&&orderDetails.indentState != 2&&orderDetails.indentState != 9&&orderDetails.indentState != 10">
<!-- <view style="font-size: 31rpx;color: black;padding: 20rpx 25rpx;">联系骑手...</view> -->
<view class="flex justify-between align-center padding">
<view style="font-size: 31rpx;color: black;">联系骑手...</view>
<image @click="complaint" src="../../static/images/order/tousu.png" style="width: 43rpx;height: 39rpx;"
mode=""></image>
</view>
<view>
<u-line color="#F2F2F2" />
</view>
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;">
<view class="rider_left">
<image :src="orderDetails.avatar"></image>
</view>
<view style="margin-left: 10rpx;color: #333333;">
<view>{{orderDetails.riderNickName}}</view>
<view>{{orderDetails.phone1}}</view>
</view>
</view>
<view class="phone" @click="bindphone()">联系TA</view>
</view>
</view>
<!-- 收货码 -->
<view class="five_box1">
<view class="part_seven" v-if="orderDetails.orderCode">
<text>收货码</text>
<text>{{orderDetails.orderCode}}</text>
</view>
<!-- 备注 -->
<view class="part_seven"
v-if="orderDetails.indentType != 4&&orderDetails.indentType != 3&&orderDetails.remarks">
<text>备注</text>
<view style="text-align: right;flex: 1;">{{orderDetails.remarks}}</view>
</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}}
<u-icon @click="copy(orderDetails.indentNumber)" name="cut" style="margin-left: 6rpx;" size="32">
</u-icon>
</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_sevens">
<view class="order_info">
订单下单支出
</view>
<!-- <view class="order_list">
<view class="order_name">跑腿费</view>
<view class="order_nums">{{orderDetails.errandMoney}}</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.prepayMoney">
<view class="order_name">预付价格</view>
<view class="order_nums">¥{{orderDetails.prepayMoney}}</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.cargoInsuranceFlag == 0">
<view class="order_name">物品保价</view>
<view class="order_nums">¥{{orderDetails.cargoInsurance}}</view>
</view>
<view class="order_list" v-if="orderDetails.indentMoney">
<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>
<!-- <image
v-if="orderDetails.indentState ==3||orderDetails.indentState ==4||orderDetails.indentState ==5||orderDetails.indentState ==6||orderDetails.indentState ==7"
src="../../static/images/order/kefu.png"
style="width: 100rpx;height: 100rpx;position: fixed;bottom: 100rpx;right: 70rpx;" @click="goChat()" mode="">
</image> -->
</view>
</template>
<script>
export default {
data() {
return {
orderDetails: '',
latitude: '',
longitude: '',
markers: [], //标记点
lat: '',
lng: ''
}
},
onLoad(e) {
let that = this
this.indentNumber = e.indentNumber
that.userList()
},
methods: {
getLocation(e) {
let data = {
riderUserId: e,
lat: this.lat,
lng: this.lng
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
console.log(res.data, '经纬度')
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.markers = [{
id: 1,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40'
}]
}
});
},
goMap() {
uni.navigateTo({
url: '/pages/order/paotuiMap?indentNumber=' + this.indentNumber
})
},
goChat() {
uni.navigateTo({
url: '/pages/index/shop/im?ordersId=' + this.orderDetails.indentId
})
},
// 拨打电话
bindphone() {
uni.makePhoneCall({
phoneNumber: this.orderDetails.phone
});
},
//请求详情数据
userList() {
let that=this;
this.$Request.postT('/app/tbindent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
this.orderDetails = res.data
if (this.orderDetails.phone) {
this.orderDetails.phone1 = this.orderDetails.phone.substring(0, 3) + "****" + this
.orderDetails.phone.substring(7, 11);
}
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function(res) {
that.lat = res.latitude;
that.lng = res.longitude;
that.getLocation(this.orderDetails.riderUserId)
}
});
}
});
},
// 再来一单
bindorder(e) {
console.log(e)
if (e.indentType == 1 || e.indentType == 2) {
let index = e.indentType
uni.navigateTo({
url: '/running/Helpsend/Helpsend?indentNumber=' + e.indentNumber + '&index=' + index
})
} else if (e.indentType == 3) {
let index = e.indentType
let current = e.buyType
uni.navigateTo({
url: '/running/Helppay/Helppay?indentNumber=' + e.indentNumber + '&index=' + index +
'&current=' + current
})
} else {
let index = e.indentType
uni.navigateTo({
url: '/running/Cityservice/Cityservice?indentNumber=' + e.indentNumber + '&index=' + index
})
}
},
// 去评论
bindcomment(e) {
console.log(e)
uni.navigateTo({
url: '/pages/order/comments/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
.riderUserId
})
},
// 取消订单
bindorderOff(e) {
// console.log(e)this.orderDetails.userFine
let indentNumber = e.indentNumber
console.log(indentNumber)
uni.showModal({
title: '温馨提示',
content: '确定取消订单?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
this.$Request.postT('/app/tbindent/userCancleIndent?indentNumber=' + indentNumber)
.then(res => {
// console.log(res)
if (res.code == 0) {
uni.showToast({
title: '订单取消成功'
});
this.userList()
// setTimeout(function() {
// uni.navigateBack();
// }, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '订单失败',
content: res.msg
});
}
});
}
}
});
},
//确认订单
bindconfirm(e) {
// console.log(e)
let indentNumber = e.indentNumber
console.log(indentNumber)
this.$Request.postT('/app/tbindent/userDelivery?indentNumber=' + indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
uni.showToast({
title: '订单确认成功'
});
this.userList()
// setTimeout(function() {
// uni.navigateBack();
// }, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '订单确认失败',
content: res.msg
});
}
});
},
// 立即付款
bindorderpay(e) {
console.log(e)
let indentNumber = e.indentNumber
uni.navigateTo({
url: '/running/order/pay/pay?indentNumber=' + indentNumber
})
},
copy(e) {
uni.setClipboardData({
data: e,
success: () => {
uni.showToast({
title: '复制成功'
})
}
})
},
complaint() {
uni.navigateTo({
url: '/pages/order/complaint/complaint?indentNumber=' + this.orderDetails.indentNumber +
'&indentType=' + this.orderDetails.indentType
})
},
}
}
</script>
<style>
body {
background: #F5F5F5;
}
/* #ifndef MP-WEIXIN */
page {
background: #F2EDED;
}
/* #endif */
.order_details {
width: 100%;
padding-bottom: 100rpx;
}
/* 待支付 */
.part_one {
width: 95%;
margin: 0 auto;
height: 230rpx;
background: #ffffff;
border-radius: 10rpx;
margin-top: 30rpx;
}
.city_box {
width: 110rpx;
line-height: 42rpx;
background: #c4e2ff;
color: #49A5FF;
text-align: center;
font-size: 30rpx;
height: 42rpx;
}
.city_pay {
width: 90%;
margin: 0 auto;
display: flex;
height: 80rpx;
justify-content: left;
align-items: center;
}
.city_pay text {
font-size: 30rpx;
letter-spacing: 2rpx;
margin-left: 15rpx;
}
.rider_order {
width: 90%;
margin: 0 auto;
font-size: 36rpx;
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: 10rpx;
padding: 15rpx 15rpx;
}
.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; */
width: 10%;
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; */
width: 85%;
font-size: 31rpx;
}
.add {
/* color: #333333;
font-size: 31rpx;
letter-spacing: 2upx;
font-weight: bold;
margin-top: 20upx; */
}
.name {
display: inline;
font-size: 30rpx;
color: #999999;
}
.name text {
color: #999999;
font-size: 30rpx;
margin-left: 30upx;
}
.address_pay {
display: flex;
width: 90%;
margin: 0 auto;
height: 80rpx;
line-height: 80rpx
}
.runing_pay {
flex: 1;
color: #999999;
font-size: 30rpx;
letter-spacing: 1rpx;
}
.runing_distance {
flex: 1;
color: #999999;
font-size: 30rpx;
letter-spacing: 1rpx;
text-align: end;
}
.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: 10rpx;
font-size: 35rpx;
display: flex;
justify-content: space-between;
}
.five_box1 {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
font-size: 35rpx;
/* display: flex;
justify-content: space-between; */
}
.part_five {
/* height: 85rpx; */
display: flex;
justify-content: space-between;
padding: 20rpx 20rpx;
border-radius: 10rpx;
}
.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: 10rpx;
/* margin-bottom: 100rpx; */
}
.order_info {
width: 90%;
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;
background: #FFFFFF;
border-radius: 10rpx;
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: 28rpx;
line-height: 60upx;
text-align: center;
border: 1upx solid #9C9C9C;
border-radius: 20upx;
color: #9C9C9C;
margin-right: 30upx;
}
.btn2 {
width: 170upx;
line-height: 60upx;
color: white;
background: #FF6A04;
font-size: 22upx;
text-align: center;
margin-right: 10rpx;
border-radius: 20upx;
}
.phone_bd {
display: inline-block;
background: #FF6A04;
color: #ffffff;
padding: 0rpx 15rpx;
margin-left: 14rpx;
border-radius: 10rpx;
}
.part_seven {
padding: 20rpx 0;
width: 90%;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 auto;
color: #999999;
}
.part_sevens {
width: 95%;
margin: 0 auto;
/* height: 275rpx; */
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
padding-bottom: 20rpx;
margin-bottom: 100rpx;
}
/* 联系骑手 */
.rider_box {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
}
.rider_left image {
width: 80rpx;
height: 85rpx;
border-radius: 60%;
}
.phone {
background: #FD6416;
color: #ffffff;
padding: 8rpx 15rpx;
border-radius: 13rpx;
font-size: 24rpx;
}
</style>

442
pages/order/feedback.vue Normal file
View File

@@ -0,0 +1,442 @@
<template>
<view class="page">
<!-- <view class="feedback-title"> -->
<!-- <text>评价</text> -->
<!-- <text @tap="chooseMsg">快速键入</text> -->
<!-- </view> -->
<view class="feedback-body">
<textarea placeholder="请输入你的评价..." v-model="sendDate.content" class="feedback-textare" />
</view>
<!-- <view class="feedback-title"><text>QQ/邮箱</text></view> -->
<!-- <view class="feedback-body"><input class="feedback-input" v-model="sendDate.mail" placeholder="方便我们联系你 " /></view> -->
<view class="text-white padding bg radius margin-tb">
<view>
<view class="text-lg margin-top-sm text-black">商品评价图可多张</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view>
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
v-for="(image,index) in shopBanner" :key="index">
<!-- <image :src="image" style="width: 100%;height: 100%;"></image> -->
<image :src="image" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(index)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;" @click="addImages(2)" v-if="shopBanner.length<9">
<!-- <image :src="image" style="width: 100%;height: 100%;"></image> -->
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="/static/images/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="feedback-title feedback-star-view">
<text>订单评分</text>
<view class="feedback-star-view">
<!-- <text class="feedback-star" v-for="(value, key) in stars" :key="key" :class="key < sendDate.score ? 'active' : ''" @tap="chooseStar(value)"></text> -->
</view>
<u-rate :count="count" min-count='1' active-color="#FCD202" v-model="value"></u-rate>
</view>
<button type="primary" style="background: #FCD202;margin-top: 32upx;" class="feedback-submit"
@tap="send">提交</button>
</view>
</template>
<script>
import configUrl from '../../common/config.js'
export default {
data() {
return {
shopBanner: [],
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视丑哭了', '偶发性崩溃'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
content: '',
contact: '',
goodsId: '',
ordersId: '',
orderNumber: '',
shopId: ''
},
count: 5,
value: 5,
goodsId: '',
ordersId: '',
orderNumber: '',
};
},
onLoad(e) {
this.sendDate.goodsId = e.goodsId
this.sendDate.ordersId = e.ordersId
this.sendDate.orderNumber = e.orderNumber
this.sendDate.shopId = e.shopId
// let deviceInfo = {
// appid: plus.runtime.appid,
// imei: plus.device.imei, //设备标识
// p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型i表示iOS平台a表示Android平台。
// md: plus.device.model, //设备型号
// app_version: plus.runtime.version,
// plus_version: plus.runtime.innerVersion, //基座版本号
// os: plus.os.version,
// net: '' + plus.networkinfo.getCurrentType()
// };
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
},
methods: {
// 图片上传
addImages(e) {
let that = this
uni.chooseImage({
count: 9,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
// url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
// url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
url:configUrl.APIHOST+'/alioss/upload',
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (that.shopBanner.length < 9) {
if(JSON.parse(uploadFileRes.data).data){
that.shopBanner.push(JSON.parse(uploadFileRes.data).data)
}else{
uni.showToast({
title:'图片上传失败,请重试',
icon:'none'
})
}
}
console.log(that.shopBanner)
uni.hideLoading();
}
});
}
}
})
},
// 评价图删除
removeImg(index) {
this.shopBanner.splice(index, 1)
},
close(e) {
this.imageList.splice(e, 1);
},
chooseMsg() {
//快速输入
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
this.sendDate.content = this.msgContents[res.tapIndex];
}
});
},
chooseImg() {
//选择图片
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
},
chooseStar(e) {
//点击评星
this.sendDate.score = e;
},
previewImage() {
//预览图片
uni.previewImage({
urls: this.imageList
});
},
send() {
//发送反馈
// console.log(this.sendDate,'111111111');
// console.log(this.shopBanner.join(','),'22222222222222222')
if (!this.sendDate.content) {
uni.showToast({
icon: 'none',
title: '请输入评价内容'
});
return;
}
if(!this.shopBanner.length){
uni.showToast({
icon: 'none',
title: '请上传商品评价图'
});
return;
}
this.$queue.showLoading('加载中...');
console.log(this.orderNumber)
this.$Request.postJson('/app/order/insertEvaluate', {
goodsId: this.sendDate.goodsId,
ordersId: this.sendDate.ordersId,
orderNumber: this.sendDate.orderNumber,
evaluateMessage: this.sendDate.content,
score: this.value,
shopId: this.sendDate.shopId,
pictures:this.shopBanner.length>0?this.shopBanner.join(','):[]
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '评价成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '评价失败',
content: res.msg
});
}
});
}
}
};
</script>
<style>
@font-face {
font-family: uniicons;
font-weight: normal;
font-style: normal;
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
}
page {
background-color: #FFFFFF;
}
view {
font-size: 28upx;
}
.input-view {
font-size: 28upx;
}
.close-view {
text-align: center;
line-height: 14px;
height: 16px;
width: 16px;
border-radius: 50%;
background: #ff5053;
color: #ffffff;
position: absolute;
top: -6px;
right: -4px;
font-size: 12px;
}
/* 上传 */
.uni-uploader {
flex: 1;
flex-direction: column;
}
.uni-uploader-head {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.uni-uploader-info {
color: #b2b2b2;
}
.uni-uploader-body {
margin-top: 16upx;
}
.uni-uploader__files {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.uni-uploader__file {
margin: 10upx;
width: 210upx;
height: 210upx;
}
.uni-uploader__img {
display: block;
width: 210upx;
height: 210upx;
}
.uni-uploader__input-box {
position: relative;
margin: 10upx;
width: 208upx;
height: 208upx;
border: 2upx solid #d9d9d9;
}
.uni-uploader__input-box:before,
.uni-uploader__input-box:after {
content: ' ';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.uni-uploader__input-box:before {
width: 4upx;
height: 79upx;
}
.uni-uploader__input-box:after {
width: 79upx;
height: 4upx;
}
.uni-uploader__input-box:active {
border-color: #999999;
}
.uni-uploader__input-box:active:before,
.uni-uploader__input-box:active:after {
background-color: #999999;
}
.uni-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
/*问题反馈*/
.feedback-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20upx;
color: #8f8f94;
font-size: 28upx;
}
.feedback-star-view.feedback-title {
justify-content: flex-start;
margin: 0;
}
.feedback-quick {
position: relative;
padding-right: 40upx;
}
.feedback-quick:after {
font-family: uniicons;
font-size: 40upx;
content: '\e581';
position: absolute;
right: 0;
top: 50%;
color: #bbb;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.feedback-body {
font-size: 32upx;
padding: 16upx;
margin: 16upx;
border-radius: 16upx;
background: #F2F2F2;
color: #FFF;
}
.feedback-textare {
height: 200upx;
font-size: 30upx;
line-height: 50upx;
width: 100%;
box-sizing: border-box;
padding: 10upx 0upx 0;
color: #8f8f94;
}
.feedback-input {
font-size: 32upx;
height: 60upx;
padding: 15upx 20upx;
line-height: 60upx;
}
.feedback-uploader {
padding: 22upx 20upx;
}
.feedback-star {
font-family: uniicons;
font-size: 40upx;
margin-left: 6upx;
}
.feedback-star-view {
margin-left: 20upx;
}
.feedback-star:after {
content: '\e408';
}
.feedback-star.active {
color: #ffb400;
}
.feedback-star.active:after {
content: '\e438';
}
.feedback-submit {
background: #007aff;
color: #ffffff;
margin: 20upx;
}
</style>

449
pages/order/feedbacks.vue Normal file
View File

@@ -0,0 +1,449 @@
<template>
<view class="page">
<view class="feedback-title">
<text>是否满意</text>
<text @tap="chooseMsg">{{satisfactionFlagName?satisfactionFlagName:'请选择是否满意'}}</text>
</view>
<view class="feedback-body">
<textarea placeholder="请输入你的评价..." v-model="sendDate.content" class="feedback-textare" />
</view>
<!-- <view class="feedback-title"><text>QQ/邮箱</text></view> -->
<!-- <view class="feedback-body"><input class="feedback-input" v-model="sendDate.mail" placeholder="方便我们联系你 " /></view> -->
<!-- <view class="text-white padding bg radius margin-tb-sm">
<view>
<view class="text-lg text-black">评价图可多张</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view>
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
v-for="(image,index) in shopBanner" :key="index">
<image :src="image" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(index)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;" @click="addImages(2)" v-if="shopBanner.length<9">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="/static/images/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view> -->
<!-- <view class="feedback-title feedback-star-view">
<text>订单评分</text>
<view class="feedback-star-view">
</view>
<u-rate :count="count" min-count='1' active-color="#FCD202" v-model="value"></u-rate>
</view> -->
<button type="primary" style="background: #FCD202;margin-top: 32upx;" class="feedback-submit"
@tap="send">提交</button>
</view>
</template>
<script>
import configUrl from '../../common/config.js'
export default {
data() {
return {
satisfactionFlag:0,
satisfactionFlagName:'满意',
shopBanner: [],
msgContents: ['满意', '不满意'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
content: '',
contact: '',
goodsId: '',
ordersId: '',
orderNumber: '',
shopId: ''
},
count: 5,
value: 5,
goodsId: '',
ordersId: '',
orderNumber: '',
indentNumber:''
};
},
onLoad(e) {
this.indentNumber = e.indentNumber;
// this.sendDate.goodsId = e.goodsId
// this.sendDate.ordersId = e.ordersId
// this.sendDate.orderNumber = e.orderNumber
// this.sendDate.shopId = e.shopId
// let deviceInfo = {
// appid: plus.runtime.appid,
// imei: plus.device.imei, //设备标识
// p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型i表示iOS平台a表示Android平台。
// md: plus.device.model, //设备型号
// app_version: plus.runtime.version,
// plus_version: plus.runtime.innerVersion, //基座版本号
// os: plus.os.version,
// net: '' + plus.networkinfo.getCurrentType()
// };
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
},
methods: {
// 图片上传
addImages(e) {
let that = this
uni.chooseImage({
count: 9,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
// url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
// url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
url:configUrl.APIHOST+'/alioss/upload',
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (that.shopBanner.length < 9) {
if(JSON.parse(uploadFileRes.data).data){
that.shopBanner.push(JSON.parse(uploadFileRes.data).data)
}else{
uni.showToast({
title:'图片上传失败,请重试',
icon:'none'
})
}
}
console.log(that.shopBanner)
uni.hideLoading();
}
});
}
}
})
},
// 评价图删除
removeImg(index) {
this.shopBanner.splice(index, 1)
},
close(e) {
this.imageList.splice(e, 1);
},
chooseMsg() {
//快速输入
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
console.log(res.tapIndex)
this.satisfactionFlagName = this.msgContents[res.tapIndex];
this.satisfactionFlag = res.tapIndex;
}
});
},
chooseImg() {
//选择图片
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
},
chooseStar(e) {
//点击评星
this.sendDate.score = e;
},
previewImage() {
//预览图片
uni.previewImage({
urls: this.imageList
});
},
send() {
//发送反馈
// console.log(this.sendDate,'111111111');
// console.log(this.shopBanner.join(','),'22222222222222222')
if(!this.satisfactionFlagName){
uni.showToast({
icon: 'none',
title: '请选择是否满意'
});
return;
}
if (!this.sendDate.content) {
uni.showToast({
icon: 'none',
title: '请输入评价内容'
});
return;
}
// if(!this.shopBanner.length){
// uni.showToast({
// icon: 'none',
// title: '请上传评价图'
// });
// return;
// }
this.$queue.showLoading('加载中...');
// console.log(this.orderNumber)
this.$Request.postJson('/app/apperrandevaluate/userEvaluate', {
indentNumber: this.indentNumber,
evaluateMessage: this.sendDate.content,
satisfactionFlag: this.satisfactionFlag
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '评价成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '评价失败',
content: res.msg
});
}
});
}
}
};
</script>
<style>
@font-face {
font-family: uniicons;
font-weight: normal;
font-style: normal;
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
}
page {
background-color: #FFFFFF;
}
view {
font-size: 28upx;
}
.input-view {
font-size: 28upx;
}
.close-view {
text-align: center;
line-height: 14px;
height: 16px;
width: 16px;
border-radius: 50%;
background: #ff5053;
color: #ffffff;
position: absolute;
top: -6px;
right: -4px;
font-size: 12px;
}
/* 上传 */
.uni-uploader {
flex: 1;
flex-direction: column;
}
.uni-uploader-head {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.uni-uploader-info {
color: #b2b2b2;
}
.uni-uploader-body {
margin-top: 16upx;
}
.uni-uploader__files {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.uni-uploader__file {
margin: 10upx;
width: 210upx;
height: 210upx;
}
.uni-uploader__img {
display: block;
width: 210upx;
height: 210upx;
}
.uni-uploader__input-box {
position: relative;
margin: 10upx;
width: 208upx;
height: 208upx;
border: 2upx solid #d9d9d9;
}
.uni-uploader__input-box:before,
.uni-uploader__input-box:after {
content: ' ';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.uni-uploader__input-box:before {
width: 4upx;
height: 79upx;
}
.uni-uploader__input-box:after {
width: 79upx;
height: 4upx;
}
.uni-uploader__input-box:active {
border-color: #999999;
}
.uni-uploader__input-box:active:before,
.uni-uploader__input-box:active:after {
background-color: #999999;
}
.uni-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
/*问题反馈*/
.feedback-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20upx;
color: #333333;
font-size: 28upx;
}
.feedback-star-view.feedback-title {
justify-content: flex-start;
margin: 0;
}
.feedback-quick {
position: relative;
padding-right: 40upx;
}
.feedback-quick:after {
font-family: uniicons;
font-size: 40upx;
content: '\e581';
position: absolute;
right: 0;
top: 50%;
color: #bbb;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.feedback-body {
font-size: 32upx;
padding: 16upx;
margin: 16upx;
border-radius: 16upx;
background: #F2F2F2;
color: #FFF;
}
.feedback-textare {
height: 200upx;
font-size: 30upx;
line-height: 50upx;
width: 100%;
box-sizing: border-box;
padding: 10upx 0upx 0;
color: #8f8f94;
}
.feedback-input {
font-size: 32upx;
height: 60upx;
padding: 15upx 20upx;
line-height: 60upx;
}
.feedback-uploader {
padding: 22upx 20upx;
}
.feedback-star {
font-family: uniicons;
font-size: 40upx;
margin-left: 6upx;
}
.feedback-star-view {
margin-left: 20upx;
}
.feedback-star:after {
content: '\e408';
}
.feedback-star.active {
color: #ffb400;
}
.feedback-star.active:after {
content: '\e438';
}
.feedback-submit {
background: #007aff;
color: #ffffff;
margin: 20upx;
}
</style>

1511
pages/order/index.vue Normal file

File diff suppressed because it is too large Load Diff

205
pages/order/paotuiMap.vue Normal file
View File

@@ -0,0 +1,205 @@
<template>
<view v-if="XCXIsSelect=='是'">
<map id="map" style="width: 100%; height: 700px;" :latitude="latitude" :longitude="longitude" :markers="markers"
:show-location="true">
</map>
<cover-view class="controls-title">
<cover-view class="tabs_box">
<cover-image class="pay_img" src="../../static/images/order/avatar.png"></cover-image>
<cover-view class="flex flex-sub margin-left-sm flex-direction justify-between">
<cover-view class="pay_name">骑手预计{{rider.mDateTime[1]}}送达</cover-view>
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
距离您{{rider.aDouble}}
</cover-view>
</cover-view>
<cover-view class="flex">
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/order/im.png"></cover-image>
<cover-image class="pay_img1" @click="call" src="../../static/images/order/phone.png"></cover-image>
</cover-view>
</cover-view>
</cover-view>
</view>
</template>
<script>
export default {
data() {
return {
latitude: '',
longitude: '',
markers: [], //标记点
indentNumber: '',
riderUserId: '',
orderDetails: {},
rider: {},
timer: '',
XCXIsSelect: '是',
}
},
onLoad(option) {
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
if (this.XCXIsSelect == '否') {
this.getGuize()
uni.setNavigationBarTitle({
title: '隐私政策'
});
} else {
uni.setNavigationBarTitle({
title: '地图'
});
}
let that = this
that.indentNumber = option.indentNumber
that.getData()
},
onShow() {
let that = this
this.timer = setInterval(function() {
that.getLocation()
}, 10000)
},
onHide() {
console.log(this.timer,'定时器')
clearInterval(this.timer)
},
methods: {
getData() {
this.$Request.postT('/app/tbindent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
this.orderDetails = res.data
console.log(this.orderDetails.avatar)
let marker = {
id: 1,
latitude: res.data.userLat,
longitude: res.data.userLng,
iconPath: '../../static/images/order/01.png',
width: '40',
height: '40'
}
this.markers.push(marker)
this.riderUserId = this.orderDetails.riderUserId
this.getLocation()
console.log(this.markers)
}
});
},
getLocation() {
let data = {
riderUserId: this.riderUserId,
lat: this.orderDetails.userLat,
lng: this.orderDetails.userLng
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.rider = res.data
this.rider.mDateTime = res.data.mDateTime.split(' ')
if (this.rider.aDouble > 1000) {
this.rider.aDouble = Number((this.rider.aDouble / 1000)).toFixed(2)+"km"
}else{
if(this.rider.aDouble==0){
this.rider.aDouble = "0m";
}else{
this.rider.aDouble = Number(this.rider.aDouble).toFixed(1) +"m";
}
}
let marker = {
id: 2,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40',
}
this.markers.push(marker)
}
});
},
call() {
uni.makePhoneCall({
phoneNumber: this.orderDetails.phone
});
},
goNav() {
uni.navigateTo({
url: '/pageA/kefu/kefu'
})
}
},
}
</script>
<style>
.controls-title {
width: 90%;
/* height: 220upx; */
/* line-height: 220upx; */
background: #FFFFFF;
position: fixed;
bottom: 0rpx;
margin: 40upx;
border-radius: 26upx;
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
/* margin: 0 40rpx; */
margin-bottom: 50rpx;
}
.tabs_box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx;
margin: 20rpx;
}
.pay_tit {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.pay_img {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.pay_img1 {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
}
.tabs_bottom {
margin: 0 20rpx 20rpx;
display: flex;
}
.pay_btn {
padding: 5rpx 16rpx;
border: solid 2rpx #999999;
margin-right: 20rpx;
display: flex;
align-items: center;
border-radius: 10rpx;
}
.pay_name {
font-size: 32rpx;
font-weight: bold;
}
.pay_line {
height: 2rpx;
background-color: #afafaf;
margin: 10rpx 0;
}
</style>

623
pages/order/takefood.vue Normal file
View File

@@ -0,0 +1,623 @@
<template>
<view class="pages" v-if="XCXIsSelect=='是'">
<!-- 余额 -->
<view class="tosend" v-if="dataDet">
<view class="tosend_text" v-if="dataDet.status == 3&&dataDet.orderType==1">待取餐</view>
<view class="tosend_text" v-if="dataDet.status == 3&&dataDet.orderType==2">配送中</view>
<view class="tosend_text" v-if="dataDet.status == 4">已完成</view>
<view class="tosend_text" v-if="dataDet.status == 5">已取消</view>
<view class="tosend_text" v-if="dataDet.status == 6">制作中</view>
<view class="tosend_text" v-if="dataDet.status == 7">待接单</view>
<view class="tosend_text" v-if="dataDet.status == 8">已取消</view>
<view class="flex justify-center" v-if="dataDet.orderType==1" style="width: 100%;height: 140rpx;margin-bottom: 30rpx;">
<view class="flex justify-center" style="width: 94%;height: 100%;border-radius: 18rpx;background-color: #ffffff;padding: 3%;">
<view class="flex justify-between align-center" style="width: 100%;height: 100%;">
<image :src="shopInfo.shopCover?shopInfo.shopCover:'../../static/logo.png'" style="width: 110rpx;height: 110rpx;border-radius: 8rpx;" mode=""></image>
<view class="flex flex-wrap align-center" style="width: 80%;height: 100%;">
<view class="" style="width: 100%;font-size: 30rpx;" @click="call">
<text style="font-weight: bold;">{{shopInfo.shopName?shopInfo.shopName:''}}</text>
<text style="margin-left: 10rpx;font-weight: bold;">{{shopInfo.phones?shopInfo.phones:''}}</text>
<u-icon name="phone" size="30" color="#999999" style=""></u-icon>
</view>
<view class="flex align-center" style="width: 100%;color: #999999;font-size: 24rpx;" @click="goMaps">
<u-icon name="map" size="30" color="#999999" style="margin-right: 10rpx;"></u-icon>
{{shopInfo.detailedAddress?shopInfo.detailedAddress:''}}
</view>
</view>
</view>
</view>
</view>
<view class="tosend_header">
<!-- 排序 -->
<view class="cont_two_top" v-if="dataDet.status == 3&&dataDet.orderType==1">
<view class="cont_two_top_le">取餐号码</view>
<!-- <view class="cont_two_top_ri">制作中</view> -->
</view>
<view v-if="dataDet.status == 3&&dataDet.orderType==1" class="cont_two_text">{{dataDet.orderCode}}
</view>
<view v-if="dataDet.status == 3&&dataDet.orderType==1" class="cont_two_text2">
前面还有<text>{{dataDet.countOrder}}</text>个订单</view>
<!-- 商品列表 -->
<view v-if="dataDet" class="tosend_header_food" v-for="(item,index) in dataDet.orderGoodsList"
:key='index'>
<view class="tosend_header_food_le">
<image :src="item.goodsPicture[0]" style="border-radius: 10rpx;" mode=""></image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between align-center">
<view class="text-lg text-bold text-black">{{item.goodsName}}</view>
<view class="text-lg text-bold text-black"><text class="text-sm">¥</text>{{item.goodsPrice}}
</view>
</view>
<view class="flex justify-between align-center text-gray">
<view v-if="item.skuMessage">{{item.skuMessage}}</view>
<view>X{{item.goodsNum}}</view>
</view>
<view class="flex justify-between align-center text-gray" v-if="item.goodsPack">
<view>打包费</view>
<view>{{item.goodsPack}} / </view>
</view>
</view>
</view>
<view class="tosend_header_do " v-if="dataDet.couponMoney>0">
<view>优惠券</view>
<view class="tosend_header_do_ri">-{{dataDet.couponMoney}}</view>
</view>
<view class="tosend_header_do do_bot" v-if="dataDet.errandMoney>0&&dataDet.orderType==2">
<view>跑腿费</view>
<view class="tosend_header_do_ri">{{dataDet.errandMoney}}</view>
</view>
<view class="tosend_header_do">
<view class="tosend_header_do_le2">实付</view>
<view class="tosend_header_do_ri2"><text></text>{{dataDet.payMoney}}</view>
</view>
</view>
<view class="text-center" v-if="dataDet">
<map v-if="dataDet.status == 3 && latitude && longitude" id="map" @tap="goMap"
style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers" :latitude="latitude"
:longitude="longitude"></map>
</view>
<!-- 骑手信息 -->
<view class="rider_box" v-if="dataDet&&(dataDet.status == 3||dataDet.status == 4)&&dataDet.riderUserId">
<view class="flex justify-between align-center padding">
<view style="font-size: 31rpx;color: black;">联系骑手</view>
<image @click="complaint" src="../../static/images/order/tousu.png"
style="width: 43rpx;height: 39rpx;" mode=""></image>
</view>
<view>
<u-line color="#F2F2F2" />
</view>
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;">
<view class="rider_left">
<image :src="dataDet.riderAvatar"></image>
</view>
<view style="margin-left: 10rpx;color: #333333;">
<view>{{dataDet.riderUserName}}</view>
<view>{{dataDet.riderPhone1}}</view>
</view>
</view>
<view class="phone" @click="bindphone(dataDet.riderPhone)">联系TA</view>
</view>
</view>
<!-- 其他信息 -->
<view class="tosend_cont" v-if="dataDet">
<view class="tosend_header_text">
<text>订单信息</text>
</view>
<view class="tosend_cont_infor" v-if="dataDet.orderType==1">
<view class="tosend_cont_infor_le">取餐号码</view>
<view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view>
</view>
<view class="tosend_cont_infor">
<view class="tosend_cont_infor_le">订单编号</view>
<view class="tosend_cont_infor_ri">{{dataDet.orderNumber}}
<u-icon @click="copy(dataDet.orderNumber)" name="order" style="margin-left: 6rpx;" size="32">
</u-icon>
</view>
</view>
<view class="tosend_cont_infor">
<view class="tosend_cont_infor_le">下单时间</view>
<view class="tosend_cont_infor_ri">{{dataDet.payTime}}</view>
</view>
<view class="tosend_cont_infor">
<view class="tosend_cont_infor_le">支付方式</view>
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==1">微信支付</view>
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==2">余额支付</view>
</view>
<view class="tosend_cont_infor" v-if="dataDet.orderType==2">
<view class="tosend_cont_infor_le">联系人</view>
<view class="tosend_cont_infor_ri">{{dataDet.address.userName}}</view>
</view>
<view class="tosend_cont_infor" v-if="dataDet.orderType==2">
<view class="tosend_cont_infor_le">联系方式</view>
<view class="tosend_cont_infor_ri">{{dataDet.address.userPhone}}</view>
</view>
<view class="tosend_cont_infor" v-if="dataDet.orderType==2">
<view class="tosend_cont_infor_le">详细地址</view>
<view class="tosend_cont_infor_ri">
{{dataDet.address.province}}{{dataDet.address.city}}{{dataDet.address.district}}{{dataDet.address.addressDetail}}
</view>
</view>
<view class="tosend_cont_infor" v-if="dataDet.remark">
<view class="tosend_cont_infor_le">订单备注</view>
<view class="tosend_cont_infor_ri">
{{dataDet.remark}}
</view>
</view>
</view>
</view>
<view style="width: 100rpx;height: 100rpx;position: fixed;bottom: 100rpx;right: 70rpx;" v-if="dataDet">
<image src="../../static/images/order/kefu.png" style="width: 100%;height: 100%;" @click="goChat()" mode="">
</image>
<view class="shopxiaoix" v-if="RiderUnreadCount>0">{{RiderUnreadCount}}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
orderId: '',
dataDet: '',
markers: [], //标记点
latitude: '',
longitude: '',
RiderUnreadCount: 0,
XCXIsSelect: '是',
shopId:'',
shopInfo:{},
}
},
onLoad(option) {
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
if (this.XCXIsSelect == '否') {
uni.setNavigationBarTitle({
title: '隐私政策'
});
} else {
uni.setNavigationBarTitle({
title: '订单详情'
});
}
let that = this
uni.showLoading({
title: '加载中...'
})
that.orderId = option.orderId
that.shopId = option.shopId
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function(res) {
that.lat = res.latitude;
that.lng = res.longitude;
that.getDataDet()
},fail(e) {
uni.hideLoading();
uni.showModal({
title: '温馨提示',
content: '您的定位权限未开启,请开启后再来操作吧!',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if(res.confirm){
uni.openSetting({ // 打开设置页
success(rea) {
console.log(rea.authSetting)
}
});
}
}
});
}
});
this.getRiderUnreadCount()
this.getShopInfo()
},
created() {
this.RiderUnreadCount = setInterval(() => {
this.getRiderUnreadCount()
}, 5000)
},
methods: {
// 点击调起地图查看位置
goMaps() {
let that = this;
let lati = parseFloat(that.shopInfo.shopLat);
let longi = parseFloat(that.shopInfo.shopLng);
uni.authorize({
scope: 'scope.userLocation',
success(res) {
uni.openLocation({
name: that.shopInfo.shopName,
latitude: lati,
longitude: longi,
success: function() {}
});
},
fail(err) {}
});
},
// 打电话
call() {
uni.makePhoneCall({
phoneNumber: this.shopInfo.phone
});
},
//获取店铺信息
getShopInfo(){
let data ={
shopId:this.shopId
}
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
if(res.code == 0 && res.data){
this.shopInfo = res.data
let phoneNumber = this.shopInfo.phone.toString() //先强制转换成字符串类型
this.shopInfo.phones = phoneNumber.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
}
})
},
getDataDet() {
let data = {
orderId: this.orderId
}
this.$Request.get("/app/order/selectOrderById", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.dataDet = res.data
// this.dataDet.goodsMessage = JSON.parse(this.dataDet.goodsMessage)
this.dataDet.orderCode = this.dataDet.orderCode.substring(this.dataDet.orderCode.length -
3, this.dataDet.orderCode.length)
this.dataDet.orderGoodsList.forEach(res => {
res.goodsPicture = res.goodsPicture.split(',')
})
if (this.dataDet.riderPhone) {
this.dataDet.riderPhone1 = this.dataDet.riderPhone.substring(0, 3) + "****" + this
.dataDet.riderPhone.substring(7, 11);
}
this.dataDet.address = this.dataDet.address ? JSON.parse(this.dataDet.address) : ''
console.log(this.dataDet.address)
if (this.dataDet.riderUserId) {
this.getLocation(this.dataDet.riderUserId)
}
}
});
},
goChat() {
uni.navigateTo({
url: '/pages/index/shop/im?ordersId=' + this.orderId
})
},
getLocation(e) {
let data = {
riderUserId: e,
lat: this.lat,
lng: this.lng
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
console.log(res.data, '经纬度')
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.markers = [{
id: 1,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40'
}]
}
});
},
goMap() {
uni.navigateTo({
url: '/pages/order/waimaiMap?orderId=' + this.orderId
})
},
// 拨打电话
bindphone(e) {
console.log(e)
uni.makePhoneCall({
phoneNumber: e
});
},
complaint() {
uni.navigateTo({
url: '/pages/order/complaint/complaint?indentNumber=' + this.dataDet.indentNumber +
'&indentType=5'
})
},
copy(e) {
uni.setClipboardData({
data: e,
success: () => {
uni.showToast({
title: '复制成功'
})
}
})
},
getRiderUnreadCount() {
let that = this
let data = {
ordersId: that.orderId
}
that.$Request.getT("/app/ordersChat/selectUserUnreadCount", data).then(res => {
if (res.code == 0) {
if (res.data > 0) {
if (that.RiderUnreadCount != res.data) {
that.aplayAudio()
that.RiderUnreadCount = res.data
}
} else {
that.RiderUnreadCount = 0
}
}
});
},
// 语音播报
aplayAudio() {
// const audio = document.getElementById('audio')
// audio.play()
// console.log('语音提示')
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src =
'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
},
}
}
</script>
<style scoped>
/* 余额 */
.tosend {
width: 100%;
height: 280rpx;
background: -webkit-linear-gradient(top, #FCD202, #F5F5F5);
}
.tosend_text {
padding: 3% 3% 4%;
font-size: 48rpx;
font-weight: 800;
color: #333333;
}
.tosend_header {
width: 94%;
background-color: #FFFFFF;
margin: 0 auto;
border-radius: 18rpx;
padding: 3%;
}
/* 排序 */
.cont_two_top {
width: 100%;
display: flex;
justify-content: space-between;
}
.cont_two_top_le {
font-size: 30rpx;
font-weight: 500;
color: #333333;
}
.cont_two_top_ri {
padding: 6rpx 10rpx;
text-align: center;
background: rgba(255, 19, 10, 0.2);
font-size: 24rpx;
border: 2rpx solid #FF130A;
color: #FF130A;
opacity: 0.6;
border-radius: 8rpx;
}
.cont_two_text {
font-size: 56rpx;
text-align: center;
font-weight: bold;
color: #333333;
margin: 5% 0;
line-height: 32rpx;
}
.cont_two_text2 {
font-size: 30rpx;
width: 100%;
font-weight: 500;
color: #333333;
text-align: center;
padding-bottom: 4%;
line-height: 32rpx;
border-bottom: 1rpx solid #E6E6E6;
}
.cont_two_text2 text {
color: #FF130A;
}
/* 商品列表 */
.tosend_header_text {
font-weight: 800;
color: #333333;
line-height: 2;
font-size: 30rpx;
display: flex;
justify-content: space-between;
}
.tosend_header_food {
width: 100%;
display: flex;
margin-top: 3%;
}
.tosend_header_food_le {
width: 15%;
}
.tosend_header_food_le image {
width: 110rpx;
height: 110rpx;
}
.tosend_header_food_ce {
margin: 0 0 0 4%;
width: 57%;
}
.tosend_header_food_ri {
text-align: right;
width: 25%;
}
.tosend_header_food_text {
font-size: 34rpx;
font-weight: 500;
color: #333333;
line-height: 1.8;
}
.tosend_header_food_text text {
font-size: 25rpx;
}
.tosend_header_food_text2 {
font-size: 30rpx;
font-weight: 500;
color: #999999;
}
.do_top {
padding-top: 3%;
}
.do_bot {
padding-bottom: 3%;
border-bottom: 2rpx solid #E6E6E6;
}
.tosend_header_do {
width: 100%;
color: #333333;
font-size: 30rpx;
display: flex;
line-height: 1.5;
}
.tosend_header_do view {
flex: 1;
}
.tosend_header_do_ri {
text-align: right;
}
.tosend_header_do_le2 {
font-family: PingFang SC;
font-weight: 500;
color: #999999;
padding-top: 1.5%;
}
.tosend_header_do_ri2 {
text-align: right;
color: #EA0000;
font-size: 40rpx;
}
.tosend_header_do_ri2 text {
font-size: 30rpx;
}
/* 其他信息 */
.tosend_cont {
width: 94%;
background-color: #FFFFFF;
margin: 3% auto;
border-radius: 18rpx;
padding: 3%;
}
.tosend_cont_infor {
display: flex;
margin-top: 3%;
}
.tosend_cont_infor_le {
flex: 1;
color: #999999;
}
.tosend_cont_infor_ri {
flex: 2;
text-align: right;
color: #333333;
}
.tosend_cont_text {
text-align: right;
}
/* 联系骑手 */
.rider_box {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
}
.rider_left image {
width: 80rpx;
height: 85rpx;
border-radius: 60%;
}
.phone {
background: #FD6416;
color: #ffffff;
padding: 8rpx 15rpx;
border-radius: 13rpx;
font-size: 24rpx;
}
.shopxiaoix {
background: red;
color: #ffffff;
width: auto;
padding: 5rpx 12rpx;
height: auto;
text-align: center;
border-radius: 30rpx;
position: absolute;
top: -4rpx;
right: -4rpx;
}
</style>

216
pages/order/waimaiMap.vue Normal file
View File

@@ -0,0 +1,216 @@
<template>
<view>
<map id="map" style="width: 100%; height: 700px;" :latitude="latitude" :longitude="longitude" :markers="markers"
:show-location="true">
</map>
<cover-view class="controls-title">
<cover-view class="tabs_box">
<cover-image class="pay_img" src="../../static/images/order/avatar.png"></cover-image>
<cover-view class="flex flex-sub margin-left-sm flex-direction justify-between">
<cover-view class="pay_name">骑手预计{{rider.mDateTime[1]}}送达</cover-view>
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
距离您{{rider.aDouble}}
</cover-view>
</cover-view>
<cover-view class="flex">
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/order/im.png"></cover-image>
<cover-image class="pay_img1" @click="call" src="../../static/images/order/phone.png"></cover-image>
</cover-view>
</cover-view>
</cover-view>
</view>
</template>
<script>
export default {
data() {
return {
latitude: '',
longitude: '',
markers: [], //标记点
orderId: '',
riderUserId: '',
orderDetails: {},
rider: {},
timer: '',
lat: '',
lng: '',
}
},
onLoad(option) {
let that = this
that.orderId = option.orderId
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function(res) {
that.lat = res.latitude;
that.lng = res.longitude;
that.getData()
},fail(e) {
uni.hideLoading();
uni.showModal({
title: '温馨提示',
content: '您的定位权限未开启,请开启后再来操作吧!',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if(res.confirm){
uni.openSetting({ // 打开设置页
success(rea) {
console.log(rea.authSetting)
}
});
}
}
});
}
});
},
onShow() {
let that = this
that.timer = setInterval(function() {
that.getLocation()
}, 10000)
},
onHide() {
console.log(this.timer,'定时器')
clearInterval(this.timer)
},
onBackPress(e){
console.log("监听返回按钮事件",this.timer);
clearInterval(this.timer)
// 此处一定姚要return为true否则页面不会返回到指定路径
return true;
},
methods: {
getData() {
this.$Request.get('/app/order/selectOrderById?orderId=' + this.orderId).then(res => {
console.log(res)
if (res.code == 0) {
this.orderDetails = res.data
this.riderUserId = res.data.riderUserId
this.getLocation()
// console.log(this.markers)
}
});
},
getLocation() {
let data = {
riderUserId: this.riderUserId,
lat: this.lat,
lng: this.lng
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.rider = res.data
this.rider.mDateTime = res.data.mDateTime.split(' ')
if (this.rider.aDouble > 1000) {
this.rider.aDouble = Number((this.rider.aDouble / 1000)).toFixed(2)+"km"
}else{
if(this.rider.aDouble==0){
this.rider.aDouble = "0m";
}else{
this.rider.aDouble = Number(this.rider.aDouble).toFixed(1) +"m";
}
}
let marker = {
id: 2,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40',
}
this.markers.push(marker)
}
});
},
call() {
uni.makePhoneCall({
phoneNumber: this.orderDetails.riderPhone
});
},
goNav() {
uni.navigateTo({
url: '/my/setting/chat'
})
}
},
}
</script>
<style>
.controls-title {
width: 90%;
/* height: 220upx; */
/* line-height: 220upx; */
background: #FFFFFF;
position: fixed;
bottom: 0rpx;
margin: 40upx;
border-radius: 26upx;
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
/* margin: 0 40rpx; */
margin-bottom: 50rpx;
}
.tabs_box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx;
margin: 20rpx;
}
.pay_tit {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.pay_img {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.pay_img1 {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
}
.tabs_bottom {
margin: 0 20rpx 20rpx;
display: flex;
}
.pay_btn {
padding: 5rpx 16rpx;
border: solid 2rpx #999999;
margin-right: 20rpx;
display: flex;
align-items: center;
border-radius: 10rpx;
}
.pay_name {
font-size: 32rpx;
font-weight: bold;
}
.pay_line {
height: 2rpx;
background-color: #afafaf;
margin: 10rpx 0;
}
</style>

163
pages/public/bind.vue Normal file
View File

@@ -0,0 +1,163 @@
<template>
<view class="container">
<view class="cu-form-group" style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title">手机号</view>
<input type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" @input="inputChange" />
</view>
<view class="cu-form-group" style="margin: 30upx;border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
@confirm="toLogin" />
<button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
</view>
<button class="confirm-btn" @click="toLogin" :disabled="logining">立即换绑</button>
</view>
</view>
</template>
<script>
import listCell from '@/components/com-input';
export default {
components: {
listCell
},
data() {
return {
mobile: '',
code: '',
logining: false,
sending: false,
sendTime: '获取验证码',
count: 60,
}
},
methods: {
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
sendMsg() {
const {
mobile
} = this;
if (!mobile) {
this.$queue.showToast("请输入手机号");
} else if (mobile.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT('/appLogin/sendMsg/' + mobile + '/bind').then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
toLogin() {
const {
mobile,
code
} = this;
let userId = this.$queue.getData("userId");
if (!mobile) {
this.$queue.showToast("请输入手机号");
} else if (mobile.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else if (!code) {
this.$queue.showToast("请输入验证码");
} else {
this.$queue.showLoading("正在绑定中...");
this.$Request.postT("/app/updatePhone?msg=" + code + "&phone=" + mobile + "&userId=" + userId).then(res => {
if (res.code === 0) {
this.$queue.setData("mobile", mobile);
this.$queue.showToast('修改成功');
uni.switchTab({
url: '/pages/my/index'
});
} else {
uni.showModal({
showCancel: false,
title: '绑定失败',
content: res.msg,
});
}
uni.hideLoading();
});
}
},
},
}
</script>
<style lang='scss'>
.send-msg {
border-radius: 30px;
color: white;
height: 30px;
font-size: 14px;
line-height: 30px;
background: #e10a07;
}
.container {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #111224;
}
.confirm-btn {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #5E81F9;
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

93
pages/public/css/main.css Normal file
View 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;
}

189
pages/public/forgetPwd.vue Normal file
View File

@@ -0,0 +1,189 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title text-black">手机号</view>
<input type="number" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone" @input="inputChange" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title text-black">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
@confirm="toLogin" />
<button class="send-msg" @click="sendMsg" :disabled="sending">{{sendTime}}</button>
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title text-black">设置密码</text>
<input type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" />
</view>
</view>
<button class="confirm-btn" @click="toLogin">立即找回</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: '',
phone: '',
password: '',
sending: false,
sendTime: '获取验证码',
count: 60,
logining: false
}
},
methods: {
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phone + "/forget").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
navTo(url) {
uni.navigateTo({
url
})
},
toLogin() {
const {
phone,
password,
code
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (!password) {
this.$queue.showToast("请设置密码");
} else if (password.length < 6) {
this.$queue.showToast("密码位数必须大于六位");
} else {
this.logining = true;
this.$queue.showLoading("正在修改密码中...");
this.$Request.post("/app/Login/forgetPwd", {
pwd: password,
phone: phone,
msg: code
}).then(res => {
uni.hideLoading();
if (res.code === 0) {
uni.navigateTo({
url: '/pages/public/loginphone'
});
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
});
}
},
},
}
</script>
<style lang='scss'>
page {
background: #1E1F31 !important;
}
.send-msg {
border-radius: 30px;
color: white;
height: 30px;
font-size: 14px;
line-height: 30px;
background: #5E81F9;
}
.container {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #1E1F31;
}
.wrapper {
position: relative;
z-index: 90;
background: #1E1F31;
padding-bottom: 20px;
}
.input-content {
padding: 32upx 80upx;
}
.confirm-btn {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #5E81F9;
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

650
pages/public/login.vue Normal file
View File

@@ -0,0 +1,650 @@
<template>
<view class="container">
<!-- <image @click="navBack" src="../../static/images/index/close.png" style="width: 32upx;height: 32upx;margin-left: 46upx;"></image> -->
<!-- 小程序状态下登录 -->
<!-- #ifdef MP-WEIXIN -->
<view class="mp_wxBox">
<view>
<view class="headers">
<image src="../../static/logo.png" style="border-radius: 50%;"></image>
</view>
<view class="content">
<view>申请获取以下权限</view>
<text>获得你的公开信息(昵称头像地区等)</text>
</view>
<button v-show="weixinPhone" style="background: #FCD202;color: #333333;" class="bottom"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
授权手机号
</button>
<button v-show="!weixinPhone" style="background: #FCD202;color: #333333;" class='bottom'
bindtap="getUserProfile" @tap="wxGetUserInfo">
授权登录
</button>
</view>
</view>
<view style="text-align: center;">
<view class="footers">
<image v-if="showAgree" @tap="isShowAgree" src="../../static/images/selected.png"
style="width: 36upx;height: 36upx;"></image>
<image v-else @tap="isShowAgree" src="../../static/images/select.png"
style="width: 36upx;height: 36upx;"></image>
<text style="margin-left: 10upx;margin-right: 0;">同意</text>
<navigator url="/my/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/my/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="register">
<view class="back-btn yticon icon-zuojiantou-up" @click="navBack"></view>
<view style="padding-top: 172upx;margin-left: 36upx;">
<view style="color: #333333;font-size: 44upx;">手机快捷登录</view>
<view style="color: #999999;font-size: 24upx;margin-top: 20upx;">未注册的手机号将自动创建账号</view>
</view>
<view style="margin-left: 40upx;margin-top: 104upx;margin-right: 40upx;">
<wInput v-model="phoneData" type="number" maxlength="11" placeholder="请输入手机号"></wInput>
<!-- <wInput v-model="passData" type="number" maxlength="6" placeholder="请输入密码"></wInput> -->
<wInput v-model="verCode" type="number" maxlength="6" placeholder="请输入验证码" isShowCode ref="runCode"
@setCode="sendMsg()"></wInput>
<wInput v-show="show" v-model="invitation" isShowGet ref="setNumberCode" @setNumberCode="isShowGet()"
placeholder="请填写邀请码"></wInput>
</view>
<view class="footer">
<image v-if="showAgree" @tap="isShowAgree" src="../../static/images/selected.png"
style="width: 36upx;height: 36upx;"></image>
<image v-else @tap="isShowAgree" src="../../static/images/select.png"
style="width: 36upx;height: 36upx;"></image>
<text style="margin-left: 10upx;margin-right: 0;">同意</text>
<navigator url="/my/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/my/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
<wButton text="登 录" :rotate="isRotate" @click.native="startReg()"></wButton>
</view>
<!-- #endif -->
</view>
</template>
<script>
import wInput from '@/components/watch-login/watch-input.vue' //input
import wButton from '@/components/watch-login/watch-button.vue' //button
export default {
components: {
wInput,
wButton,
},
data() {
return {
mobile: '',
code: '',
weixinLogin: false,
sending: false,
sendTime: '获取验证码',
count: 60,
weixinPhone: false,
sendDataList: {},
sessionkey: '',
phoneNum: false,
sysphone: 1,
phoneData: '',
verCode: '',
invitation: '',
show: '',
showAgree: false, //协议是否选择
isRotate: false, //是否加载旋转
platform: "h5",
};
},
onLoad(e) {
if (e.inviterCode) {
this.$queue.setData('inviterCode', e.inviterCode);
}
//微信登录开启
this.$Request.getT('/app/common/type/53').then(res => {
if (res.code == 0) {
if (res.data && res.data.value && res.data.value == '是') {
// this.weixinLogin = true;
}
}
});
this.$Request.getT('/app/common/type/188').then(res => {
if (res.code == 0) {
if (res.data && res.data.value && res.data.value == '是') {
this.phoneNum = true;
}
}
});
},
methods: {
isShowAgree() {
this.showAgree = !this.showAgree
},
startReg() {
var that = this
uni.getSystemInfo({
success: function(res) {
console.log(res.model);
if (res.model == 'iPhone') {
that.sysphone = 2
} else if (res.model != 'iPhone') {
that.sysphone = 1
}
}
});
//注册
if (that.isRotate) {
//判断是否加载中,避免重复点击请求
return false;
}
if (!that.phoneData) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '请输入手机号'
});
return false;
}
if (that.phoneData.length != 11) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '手机号不正确'
});
return false;
}
if (that.verCode.length != 6) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '验证码不正确'
});
return false;
}
if (that.showAgree == false) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '请阅读并同意《隐私政策》和《用户服务协议》'
});
return false;
}
that.isRotate = true;
var openid = this.$queue.getData("openid") ? this.$queue.getData("openid") : '';
let data = {
phone: that.phoneData,
msg: that.verCode,
platform: that.platform,
sysPhone: that.sysphone,
openId: openid,
userType: 1
}
that.$Request.post("/app/Login/registerCode", data).then(res => {
console.log(res)
if (res.code == 0) {
console.log(res.token)
this.$queue.setData("token", res.token);
this.$queue.setData("userId", res.user.userId);
this.$queue.setData("phone", res.user.phone);
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('wxCode', res.user.wxCode)
uni.setStorageSync('wxQrCode', res.user.wxQrCode)
uni.setStorageSync('zhiFuBao', res.user.zhiFuBao)
uni.setStorageSync('zhiFuBaoName', res.user.zhiFuBaoName)
uni.switchTab({
url: '/pages/index/index'
})
return false;
} else {
that.isRotate = false;
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg,
});
}
});
},
sendMsg() {
const {
phoneData
} = this;
if (!phoneData) {
this.$queue.showToast("请输入手机号");
} else if (phoneData.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phoneData + "/login").then(res => {
console.log(res)
if (res.code == 0) {
if (res.data === 'register') {
this.show = true;
}
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.$refs.runCode.$emit('runCode');
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码',
});
}
});
}
},
wxGetUserInfo(e) {
if (this.showAgree == false) {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '请阅读并同意《隐私政策》和《用户服务协议》'
});
return false;
}
wx.getUserProfile({
desc: '业务需要',
success: infoRes => {
console.log("infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo))
let nickName = infoRes.userInfo.nickName; //昵称
let avatarUrl = infoRes.userInfo.avatarUrl; //头像
let sex = infoRes.userInfo.gender; //性别
try {
this.$queue.showLoading('正在登录中...');
this.login(nickName, avatarUrl, sex);
} catch (e) {}
}
})
},
//登录
login(nickName, avatarUrl, sex) {
let that = this;
// 1.wx获取登录用户code
uni.login({
provider: 'weixin',
success: function(loginRes) {
console.log(loginRes, '************')
let data = {
code: loginRes.code,
}
that.$Request.get('/app/Login/wxLogin', data).then(res => {
if (res.code == 0) {
uni.hideLoading()
uni.setStorageSync('openId', res.data.open_id)
uni.setStorageSync('unionId', res.data.unionId)
that.sessionkey = res.data.session_key;
let inviterCode = '';
if (uni.getStorageSync('inviterCode')) {
inviterCode = uni.getStorageSync('inviterCode')
}
let sendData = {
openId: uni.getStorageSync('openId'),
unionId: uni.getStorageSync('unionId'),
userName: nickName,
avatar: avatarUrl,
sex: sex, //性别
inviterCode: inviterCode //别人登录进来携带你的邀请码
};
that.sendDataList = sendData;
// 第一次登录获取手机号
console.log(that.phoneNum)
if (res.data.isPhone == '2' && that.phoneNum) {
that.weixinPhone = true;
} else {
that.getWeixinInfo(sendData);
}
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
});
console.log(res, '失败')
}
})
}
});
},
//小程序微信登录后获取手机号
getPhoneNumber: function(e) {
if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
console.log('用户拒绝提供手机号');
} else {
console.log('用户同意提供手机号');
console.log(e)
this.setPhoneByInsert(e.detail.encryptedData, e.detail.iv);
}
},
//小程序微信登录后获取手机号
setPhoneByInsert(decryptData, iv) {
let data = {
decryptData: decryptData,
key: this.sessionkey,
iv: iv
};
this.$Request.postJson('/app/Login/selectPhone', data).then(res => {
if (res.code == 0) {
this.phone = res.data.phoneNumber;
this.getWeixinInfo(this.sendDataList);
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
//获取个人信息
getWeixinInfo(sendData) {
let that = this;
uni.showLoading({
title: '登录中...'
});
let postData = {
openId: sendData.openId, //小程序openId
unionId: sendData.unionId, //unionId
userName: sendData.userName, //微信名称
avatar: sendData.avatar, //头像
sex: sendData.sex, //性别
phone: that.phone,
inviterCode: sendData.inviterCode
};
that.$Request.postJson('/app/Login/insertWxUser', postData).then(res => {
uni.hideLoading();
if (res.code == 0) {
uni.setStorageSync('token', res.token)
uni.setStorageSync('adminUserId', res.user.adminUserId)
uni.setStorageSync('userName', res.user.userName)
uni.setStorageSync('avatar', res.user.avatar)
uni.setStorageSync('phone', res.user.phone)
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('openId', res.user.openId)
uni.setStorageSync('zhiFuBao', res.user.zhiFuBao)
uni.setStorageSync('zhiFuBaoName', res.user.zhiFuBaoName)
// var pages = getCurrentPages();
// var currPage = pages[pages.length - 1] //当前页面
// var prePage = pages[pages.length - 2] //上一个页面
//调用上一页拉取数据的方法
// console.log(prePage.route)
// if (prePage.route == "pages/my/index") {
// prePage.$vm.getUserInfo()
// }
uni.navigateBack();
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg,
});
}
})
},
weixinLo() {
let that = this;
uni.login({
provider: 'weixin',
success: function(loginRes) {
that.$queue.showLoading('正在登录中...');
console.error(loginRes.authResult);
that.$queue.setData('weixinToken', loginRes.authResult.access_token);
that.$queue.setData('unionid', loginRes.authResult.unionid);
that.$queue.setData('weixinOpenid', loginRes.authResult.openid);
that.$Request.postJson('/app/login/loginApp', {
token: loginRes.authResult.access_token,
unionid: loginRes.authResult.unionid,
openid: loginRes.authResult.openid
}).then(res => {
console.log(JSON.stringify(res))
if (res.code === 0) {
if (uni.getSystemInfoSync().platform == "android") {
let clientid = plus.push.getClientInfo().clientid;
that.$Request.postT('/app/login/updateClientId?clientId=' +
clientid + '&userId=' + res.userId).then(res => {
});
}
that.$queue.setData("token", res.uuid);
that.$queue.setData("userId", res.userId);
that.getUserInfo(res.userId, res.token);
} else {
uni.hideLoading();
uni.navigateTo({
url: '/pages/public/wxmobile'
});
}
});
}
});
},
forget() {
uni.navigateTo({
url: '/pages/public/pwd'
});
},
register() {
uni.navigateTo({
url: '/pages/public/loginphone'
});
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
getUserInfo(userId, token) {
this.$Request.postJson('/app/selectUserById?userId=' + userId).then(res => {
if (res.code === 0) {
this.$queue.setData('token', res.data.uuid);
this.$queue.setData('image_url', res.data.imageUrl ? res.data.imageUrl :
'/static/img/common/logo.jpg');
this.$queue.setData('inviterCode', res.data.inviterCode);
this.$queue.setData('invitationCode', res.data.invitationCode);
this.$queue.setData('grade', res.data.grade);
this.$queue.setData('mobile', res.data.mobile);
this.$queue.setData('isInvitation', res.data.isInvitation);
this.$queue.setData('nickName', res.data.nickName ? res.data.nickName : res.data.phone);
this.$queue.setData('gender', parseInt(res.data.gender));
uni.switchTab({
url: '/pages/index/index'
});
} else {
uni.showModal({
showCancel: false,
title: '登录失败',
content: res.msg
});
this.$queue.logout();
}
uni.hideLoading();
});
}
}
};
</script>
<style lang="scss">
page {
height: 100%;
background: #FFF;
}
.footers {
padding-left: 140upx;
margin-top: 32upx;
font-size: 24upx;
color: #666666;
text-align: center;
display: flex;
}
.confirm-btn-weixin {
width: 200px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40upx;
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%);
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
.confirm-btn {
width: 200px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 300upx;
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%);
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
.headers {
text-align: center;
}
.headers>image {
width: 400upx;
height: 400upx;
}
.footer {
padding-left: 60upx;
margin-top: 48upx;
font-size: 24upx;
color: #666666;
text-align: center;
display: flex;
}
page {
background: #fff;
}
.send-msg {
border-radius: 30px;
color: black;
background: white;
height: 30px;
font-size: 14px;
line-height: 30px;
}
.container {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
// background: #111224;
// color: #FFF;
.mp_wxBox {
.headers {
margin: 35% auto 50rpx;
text-align: center;
border-radius: 60rpx;
width: 650rpx;
height: 300rpx;
line-height: 450rpx;
image {
width: 300rpx;
height: 300rpx;
}
}
.content {
text-align: center;
}
text {
display: block;
color: #9d9d9d;
margin-top: 40rpx;
}
.bottom {
line-height: 80upx;
border-radius: 80upx;
margin: 70rpx 50rpx;
height: 80upx;
font-size: 35rpx;
}
}
}
.wrapper {
position: relative;
z-index: 90;
background: #fff;
padding-bottom: 20px;
}
.input-content {
padding: 0 20px;
}
.confirm-btn {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 40px;
background: linear-gradient(to left, #3f5ecb 0, #5074FF 100%);
color: #fff;
// font-size: $font-lg;
&:after {
border-radius: 60px;
}
}
</style>

174
pages/public/pwd.vue Normal file
View File

@@ -0,0 +1,174 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">旧密码</text>
<input type="password" :value="oldPwd" placeholder="请输入旧密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="oldpassword" @input="inputChange" @confirm="toLogin" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">新密码</text>
<input type="password" :value="pwd" placeholder="请设置新密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" />
</view>
</view>
<button class="confirm-btn" @click="toLogin">修改密码</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: '',
phone: '',
password: '',
oldpassword: '',
sending: false,
sendTime: '获取验证码',
count: 60,
logining: false,
oldPwd: '',
pwd: ''
}
},
methods: {
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT('/appLogin/sendMsg/' + mobile + '/forget').then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
toLogin() {
const {
password,
oldpassword
} = this;
if (!oldpassword) {
this.$queue.showToast("请输入旧密码");
} else if (oldpassword.length < 6) {
this.$queue.showToast("旧密码位数必须大于六位");
} else if (!password) {
this.$queue.showToast("请设置新密码");
} else if (password.length < 6) {
this.$queue.showToast("新密码位数必须大于六位");
} else {
this.logining = true;
this.$queue.showLoading("正在修改密码中...");
this.$Request.post("/app/user/updatePwd", {
pwd : password,
oldPwd : oldpassword,
}).then(res => {
uni.hideLoading();
if (res.code === 0) {
this.$queue.showToast('密码修改成功!下次请使用新密码登录!')
setTimeout(function(){
uni.navigateBack()
},1000)
} else {
uni.showModal({
showCancel: false,
title: '密码修改失败',
content: res.msg,
});
}
});
}
},
},
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #1E1F31 !important;
}
.container {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #1E1F31 !important;
}
.wrapper {
position: relative;
z-index: 90;
background: #111224;
padding-bottom: 20px;
}
.input-content {
padding: 32upx 80upx;
}
.confirm-btn {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #5E81F9;
color: #fff;
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>