3.6(订单消息推送
This commit is contained in:
@@ -60,7 +60,7 @@ export function getSendAPI(params) {
|
||||
//汽车,订单消息列表
|
||||
export function getOrderChatList(params) {
|
||||
return request({
|
||||
url: '/api/front/community/user/my/order/chatList',
|
||||
url: '/api/front/system/article/order/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
|
||||
136
components/prompt-box/prompt-box-s.vue
Normal file
136
components/prompt-box/prompt-box-s.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<cover-view>
|
||||
<cover-view v-if="show" class="popup-box flex justify-center align-center">
|
||||
<cover-view class="popup-box-center">
|
||||
<cover-view class="popup-box-title f-34 c333">
|
||||
{{tipContent.title}}
|
||||
</cover-view>
|
||||
<cover-view class="popup-box-cont f-28 c222">
|
||||
您确定要删除该条动态吗?
|
||||
</cover-view>
|
||||
<cover-view class="popup-box-button flex justify-between">
|
||||
<cover-view class="popup-box-button-l f-34 flex justify-center align-center" @click="cancel">
|
||||
<cover-view>取消</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="popup-box-button-r f-34 flex justify-center align-center" @click="confirm">
|
||||
<cover-view>确认</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "prompt-box-s",
|
||||
props: {
|
||||
round: {
|
||||
type: String,
|
||||
default: '8'
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'center'
|
||||
},
|
||||
btnStyle: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
confirmColor: '#ffffff',
|
||||
cancelColor: '#222222',
|
||||
confirmBg: '#333333',
|
||||
cancelBg: '#ededed',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
watch: {
|
||||
show(val) {
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
tipContent: {
|
||||
title: '提示',
|
||||
content: '未查询到您的账号信息,请核实后再登陆',
|
||||
confirmText: '确认',
|
||||
cancelText: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
this.show = false
|
||||
this.$emit('confirm')
|
||||
},
|
||||
cancel() {
|
||||
this.show = false
|
||||
this.$emit('cancel')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup-box {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 750rpx;
|
||||
height: 100%;
|
||||
background-color: rgb(0, 0, 0);
|
||||
z-index: 999;
|
||||
|
||||
.popup-box-center {
|
||||
width: 520rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding-bottom: 0;
|
||||
padding: 0;
|
||||
|
||||
.popup-box-title {
|
||||
text-align: center;
|
||||
height: 50rpx;
|
||||
margin-top: 64rpx;
|
||||
|
||||
}
|
||||
|
||||
.popup-box-cont {
|
||||
text-align: center;
|
||||
color: #000;
|
||||
margin-top: 32rpx;
|
||||
height: 40rpx;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.popup-box-button {
|
||||
width: 520rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
text-align: center;
|
||||
margin-top: 64rpx;
|
||||
margin-bottom: 0;
|
||||
|
||||
.popup-box-button-l {
|
||||
width: 260rpx;
|
||||
height: 88rpx;
|
||||
background: #fff;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.popup-box-button-r {
|
||||
width: 260rpx;
|
||||
height: 88rpx;
|
||||
background: #13AFA8;
|
||||
color: #fff;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -30,11 +30,11 @@
|
||||
},
|
||||
mounted() {
|
||||
uni.hideTabBar();
|
||||
console.log(this.driverList);
|
||||
// console.log(this.driverList);
|
||||
},
|
||||
methods: {
|
||||
click_page(item) {
|
||||
console.log(item);
|
||||
// console.log(item);
|
||||
uni.switchTab({
|
||||
url: item.path
|
||||
})
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
//正式
|
||||
// baseUrl: 'https://mall.lianxianke.cn/car_app_api',
|
||||
baseUrl: 'https://mall.lianxianke.cn/car_app_api',
|
||||
TOKENNAME: 'Authori-zation',
|
||||
//薛磊测试
|
||||
baseUrl: 'http://192.168.31.226:8081/car_app_api',
|
||||
// baseUrl: 'http://192.168.31.226:8081/car_app_api',
|
||||
fileUploadUrl: 'https://mall.lianxianke.cn/car_app_api/api/front/upload/image',
|
||||
WebSocketUrl: 'ws://121.199.24.205:9107/lxk/websocket',
|
||||
WebSocketOpen: false,
|
||||
|
||||
@@ -250,9 +250,12 @@
|
||||
</z-paging>
|
||||
</view>
|
||||
<promptBox ref="pbox" @confirm="confirm"></promptBox>
|
||||
<!-- <cover-view> -->
|
||||
<tabbar-driver class="fixed-bottom" current="/pages/driver/index/index"></tabbar-driver>
|
||||
<!-- </cover-view> -->
|
||||
<!-- <cover-view v-show="true" class="popup-box flex justify-center align-center">
|
||||
<cover-view class="popup-box-center">
|
||||
啊可是觉得很愧疚撒
|
||||
</cover-view>
|
||||
</cover-view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -260,7 +263,7 @@
|
||||
import {
|
||||
shareApi
|
||||
} from "@/utils/index.js"
|
||||
import promptBox from "@/components/prompt-box/prompt-box.vue"
|
||||
import promptBox from "@/components/prompt-box/prompt-box-s.vue"
|
||||
import {
|
||||
indexTabList
|
||||
} from '@/data/tabsData'
|
||||
@@ -399,11 +402,12 @@
|
||||
},
|
||||
//删除
|
||||
delCommFn(item, index) {
|
||||
// console.log(99999, this.$refs);
|
||||
this.noteId = item.id
|
||||
this.noteIndex = index
|
||||
this.$refs.pbox.show = true
|
||||
this.$refs.pbox.tipContent.content = '您确定要删除该条动态吗?'
|
||||
this.$refs.pbox.tipContent.cancelText = '取消'
|
||||
// this.$refs.pbox.tipContent.content = '您确定要删除该条动态吗?'
|
||||
// this.$refs.pbox.tipContent.cancelText = '取消'
|
||||
},
|
||||
confirm() {
|
||||
uni.showLoading()
|
||||
@@ -940,4 +944,22 @@
|
||||
position: absolute;
|
||||
// z-index: 0;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
z-index: 999;
|
||||
|
||||
.popup-box-center {
|
||||
width: 518rpx;
|
||||
height: 336rpx;
|
||||
background-color: #fff;
|
||||
padding: 60rpx 32rpx;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -240,13 +240,13 @@
|
||||
},
|
||||
//跳转
|
||||
Navto(url, item, i) {
|
||||
console.log({
|
||||
charSn: JSON.stringify(encodeURIComponent(item.chatSn)),
|
||||
chatType: item.chatType,
|
||||
toUid: item.toUid,
|
||||
toUidNickname: item.toUidNickname,
|
||||
index: i
|
||||
});
|
||||
// console.log({
|
||||
// charSn: JSON.stringify(encodeURIComponent(item.chatSn)),
|
||||
// chatType: item.chatType,
|
||||
// toUid: item.toUid,
|
||||
// toUidNickname: item.toUidNickname,
|
||||
// index: i
|
||||
// });
|
||||
this.$u.route(url, {
|
||||
charSn: JSON.stringify(encodeURIComponent(item.chatSn)),
|
||||
chatType: item.chatType,
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 查看门店 -->
|
||||
<u-picker :show="shopShow" :columns="shopColumns" keyName="name" @confirm="shopConfirm" @close="shopShow=false"
|
||||
@cancel="shopShow=false"></u-picker>
|
||||
<!-- <u-picker :show="shopShow" :columns="shopColumns" keyName="name" @confirm="shopConfirm" @close="shopShow=false"
|
||||
@cancel="shopShow=false"></u-picker> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
data() {
|
||||
return {
|
||||
orderData: {},
|
||||
type:2
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dynamic-condition-header-r">
|
||||
<view v-if="userInfo.id == userDetail.id" class="cancel-collect red"
|
||||
@click.stop="delPersonalFn(item)">删除</view>
|
||||
<view v-else class="dynamic-condition-header-r">
|
||||
<u-icon name="more-dot-fill" color="#999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
@@ -175,10 +177,10 @@
|
||||
<image :src="item.authorAvatar" mode=""></image>
|
||||
<view class="dynamic-condition-header-l">
|
||||
<view>{{item.authorName}}</view>
|
||||
<view>IP {{item.city}} 一天前</view>
|
||||
<view>IP {{item.city}} {{item.diffDays}}天前</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="actFlaf" class="cancel-collect">取消收藏</view>
|
||||
<view v-if="userInfo.id == userDetail.id" class="cancel-collect red" @click.stop="delPersonalFn(item)">删除</view>
|
||||
<view v-else class="dynamic-condition-header-r">
|
||||
<u-icon name="more-dot-fill" color="#999" size="18"></u-icon>
|
||||
</view>
|
||||
@@ -200,7 +202,8 @@
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view v-if="item.image">
|
||||
<image style="width: 686rpx;height: 686rpx;border-radius: 8rpx;" :src="item.image" mode="aspectFill"></image>
|
||||
<image style="width: 686rpx;height: 686rpx;border-radius: 8rpx;" :src="item.image"
|
||||
mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex justify-end dynamic-condition-operate">
|
||||
<view class="f-a-i">
|
||||
@@ -283,11 +286,11 @@
|
||||
methods: {
|
||||
//私信
|
||||
//跳转消息
|
||||
Navto(url,) {
|
||||
Navto(url, ) {
|
||||
console.log(this.userDetail);
|
||||
let obj=this.userDetail
|
||||
let obj = this.userDetail
|
||||
this.$u.route(url, {
|
||||
charSn:obj.chatSn?JSON.stringify(encodeURIComponent(obj.chatSn)):'',
|
||||
charSn: obj.chatSn ? JSON.stringify(encodeURIComponent(obj.chatSn)) : '',
|
||||
toUidNickname: obj.nickname,
|
||||
toUid: obj.id,
|
||||
});
|
||||
@@ -349,7 +352,10 @@
|
||||
// console.log(this.actTab, '当前tab');
|
||||
|
||||
},
|
||||
|
||||
//删除动态
|
||||
delPersonalFn(item) {
|
||||
console.log(item);
|
||||
},
|
||||
//数据列表
|
||||
queryList(page, limit) {
|
||||
if (this.actTab == 1) {
|
||||
@@ -624,12 +630,14 @@
|
||||
.administration {
|
||||
margin-right: 180rpx;
|
||||
}
|
||||
.video-box{
|
||||
|
||||
.video-box {
|
||||
width: 686rpx;
|
||||
height: 686rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.image-list-box {
|
||||
width: 100%;
|
||||
margin-top: 24rpx;
|
||||
@@ -639,14 +647,14 @@
|
||||
height: 686rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
|
||||
.image-two {
|
||||
width: 330rpx;
|
||||
height: 330rpx;
|
||||
box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.09);
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
|
||||
.image-three {
|
||||
width: 218rpx;
|
||||
height: 218rpx;
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
<view class="order_mess">
|
||||
<view class="mess_order">
|
||||
<view class="order-txt">
|
||||
<text v-if="item.orderType==1">租车订单</text>
|
||||
<text v-else-if="item.orderType==2">买车订单</text>
|
||||
<text v-if="item.category==5">租车订单</text>
|
||||
<text v-else-if="item.category==6">买车订单</text>
|
||||
<text v-else>我的工单</text>
|
||||
</view>
|
||||
<u-badge :isDot="true" :show="item.readStatus==0" type="error"></u-badge>
|
||||
<u-badge :isDot="true" :show="item.isRead==0" type="error"></u-badge>
|
||||
</view>
|
||||
<view class="c999 f-18">订单号 : {{item.orderSn}}</view>
|
||||
<view class="c999 f-18">订单号 : {{item.messageResponse.orderNo}}</view>
|
||||
<view class="mess_xian"></view>
|
||||
<view class="mess_desc"> {{item.content}} </view>
|
||||
<view class="mess_desc"> {{item.messageResponse.message}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -39,15 +39,23 @@
|
||||
methods: {
|
||||
//详情
|
||||
navOrderXFn(item) {
|
||||
if (item.orderType == 1) {
|
||||
let orderId=item.messageResponse.id
|
||||
let orderNo=item.messageResponse.orderNo
|
||||
if (item.category == 5) {
|
||||
console.log('租车');
|
||||
uni.navigateTo({
|
||||
url: `/pages/driver/mine/my_order/rentCars/rent_particulars?id=${item.orderSn}`
|
||||
url: `/pages/driver/mine/my_order/rentCars/rent_particulars?id=${orderId}`
|
||||
})
|
||||
} else if (item.category == 6) {
|
||||
// console.log('买车');
|
||||
uni.navigateTo({
|
||||
url: `/pages/driver/mine/my_order/buyCars/buy_cars_particulars?id=${orderId}`
|
||||
})
|
||||
} else if (item.orderType == 2) {
|
||||
console.log('买车');
|
||||
} else {
|
||||
console.log('工单');
|
||||
uni.navigateTo({
|
||||
url: `/pages/driver/mine/my_order/serveOrder/work_particulars?id=${orderNo}`
|
||||
})
|
||||
}
|
||||
},
|
||||
//列表
|
||||
@@ -56,13 +64,14 @@
|
||||
limit: pageSize,
|
||||
page: pageNo
|
||||
}).then(res => {
|
||||
res.data.list.forEach(item => {
|
||||
let arr = item.content.split('&')
|
||||
item.content = arr[1]
|
||||
item.orderSn = arr[0]
|
||||
})
|
||||
this.$refs.paging.complete(res.data.list)
|
||||
console.log(res.data);
|
||||
// res.data.list.forEach(item => {
|
||||
// let arr = item.content.split('&')
|
||||
// item.content = arr[1]
|
||||
// item.orderSn = arr[0]
|
||||
// })
|
||||
this.$refs.paging.complete(res.data.list)
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,104 @@
|
||||
<template>
|
||||
<z-paging ref="paging" v-model="unknownChatList" @query="queryList" :fixed="false" use-page-scroll auto-full-height >
|
||||
<view class="m_unknow">
|
||||
<view class="unknow" v-for="(item,index) in unknownChatList" :key="index">
|
||||
<view class="unknow_l">
|
||||
<image class="unknow_img" :src="item.toUidAvatar" mode=""></image>
|
||||
</view>
|
||||
<view class="unknow_r">
|
||||
<view class="unknow_up">
|
||||
<view class="up_l">
|
||||
<view class="up_l_up"> {{item.toUidNickname}} </view>
|
||||
<view class="up_l_down">{{item.content}} </view>
|
||||
</view>
|
||||
<view v-if="item.unReadCount" class="up_r"> {{item.unReadCount||0}} </view>
|
||||
<z-paging ref="paging" v-model="unknownChatList" @query="queryList" :fixed="false" use-page-scroll auto-full-height>
|
||||
<view class="m_unknow">
|
||||
<u-swipe-action>
|
||||
<view v-for="(item,index) in unknownChatList" :key="index">
|
||||
<u-swipe-action-item :options="options2" :name="index" :index="item.id" @click="swipeAction">
|
||||
<view class="unknow"
|
||||
@click="Navto('/pages/driver/message/message_Chat/message_Chat',item,index)">
|
||||
<view class="unknow_l">
|
||||
<image class="unknow_img" :src="item.toUidAvatar" mode=""></image>
|
||||
</view>
|
||||
<view class="unknow_r">
|
||||
<view class="unknow_up">
|
||||
<view class="up_l">
|
||||
<view class="up_l_up"> {{item.toUidNickname}} </view>
|
||||
<view class="up_l_down">{{content(item.content)}} </view>
|
||||
</view>
|
||||
<view v-if="item.unReadCount" class="up_r"> {{item.unReadCount||0}} </view>
|
||||
</view>
|
||||
<view class="unknow_r_xian"></view>
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action-item>
|
||||
</view>
|
||||
<view class="unknow_r_xian"></view>
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUnknownChatList } from '@/api/message/index.js'
|
||||
import {
|
||||
deletedMgs,
|
||||
getUnknownChatList
|
||||
} from '@/api/message/index.js'
|
||||
export default {
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
unknownChatList:[]
|
||||
unknownChatList: [],
|
||||
options2: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#f56c6c',
|
||||
// height: '154rpx'
|
||||
}
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
content() {
|
||||
return (val) => {
|
||||
if (val.indexOf("{") != -1) return "一起分享";
|
||||
else return val;
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if(this.$refs.paging){
|
||||
if (this.$refs.paging) {
|
||||
this.$refs.paging.refresh();
|
||||
}
|
||||
},
|
||||
methods :{
|
||||
queryList(page,limit){
|
||||
getUnknownChatList({ limit, page }).then(res=>{
|
||||
methods: {
|
||||
//跳转
|
||||
Navto(url, item, i) {
|
||||
this.$u.route(url, {
|
||||
charSn: JSON.stringify(encodeURIComponent(item.chatSn)),
|
||||
chatType: item.chatType,
|
||||
toUid: item.toUid,
|
||||
toUidNickname: item.toUidNickname,
|
||||
index: i
|
||||
});
|
||||
},
|
||||
swipeAction({
|
||||
name
|
||||
}) {
|
||||
console.log(name);
|
||||
this.$u.throttle(() => {
|
||||
deletedMgs({
|
||||
id: this.unknownChatList[name].id
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
this.unknownChatList.splice(name, 1);
|
||||
this.$u.toast('删除成功');
|
||||
} else {
|
||||
this.$u.toast('删除失败');
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
//列表
|
||||
queryList(page, limit) {
|
||||
getUnknownChatList({
|
||||
limit,
|
||||
page
|
||||
}).then(res => {
|
||||
console.log(res.data.list);
|
||||
this.$refs.paging.complete(res.data.list)
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
this.$refs.paging.complete(false)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -50,22 +106,26 @@
|
||||
<style lang="scss">
|
||||
.unknow {
|
||||
display: flex;
|
||||
padding: 32rpx 0 0 24rpx;
|
||||
padding: 32rpx 0 0 24rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
.unknow_r {
|
||||
flex: 1;
|
||||
|
||||
.unknow_up {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-right: 24rpx;
|
||||
|
||||
.up_l {
|
||||
|
||||
|
||||
.up_l_up {
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.up_l_down {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
@@ -73,11 +133,12 @@
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.up_r {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
background:#13AFA8 ;
|
||||
background: #13AFA8;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
@@ -85,15 +146,17 @@
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.unknow_r_xian {
|
||||
height: 0rpx;
|
||||
margin-top: 46rpx;
|
||||
border-top: 1rpx solid #EDEDED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.unknow_l {
|
||||
margin-right: 36rpx;
|
||||
|
||||
.unknow_img {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
@@ -101,7 +164,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
page {
|
||||
padding: 16rpx 0;
|
||||
background: #F5F5F5;
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
import {getLocationFn} from "@/utils/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -351,6 +352,8 @@
|
||||
this.brandList = res.data
|
||||
this.modelList = res.data[0].carModelList
|
||||
})
|
||||
//获取当前位置
|
||||
getLocationFn()
|
||||
},
|
||||
onShow() {
|
||||
this.getBranner()
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
import config from '@/config'
|
||||
|
||||
import store from '@/store'
|
||||
export function uploadImg(url) {
|
||||
// 默认请求地址
|
||||
let baseURL = config.fileUploadUrl;
|
||||
@@ -31,6 +31,29 @@ export function uploadImg(url) {
|
||||
})
|
||||
})
|
||||
}
|
||||
//获取定位
|
||||
export function getLocationFn() {
|
||||
const QQMapWX = require('@/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.js')
|
||||
var qqmapsdk = new QQMapWX({
|
||||
key: 'SH4BZ-BN36N-UYSFP-SJMPC-LZMGK-EWF3P'
|
||||
})
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: res => {
|
||||
qqmapsdk.reverseGeocoder({
|
||||
location: {
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
},
|
||||
success: res1 => {
|
||||
console.log(res1.result.address_component.city);
|
||||
store.dispatch('SetCity', res1.result.address_component.city)
|
||||
},
|
||||
fail: res => {},
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
|
||||
Reference in New Issue
Block a user