Merge branch 'dev'

This commit is contained in:
weipengfei 2023-08-19 14:04:55 +08:00
commit e51a071398
11 changed files with 1183 additions and 886 deletions

90
App.vue
View File

@ -1,46 +1,60 @@
<script>
// var jpushModule = uni.requireNativePlugin("JG-JPush");
var jpushModule = uni.requireNativePlugin("JG-JPush");
//#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
onLaunch: async function () {
export default {
onLaunch: function() {
console.log('App Launch')
try {
if (!this.$store.state.app.token) uni.redirectTo({
url: '/pages/oaLogin/oaLogin'
})
} catch (e) {
uni.redirectTo({
url: '/pages/oaLogin/oaLogin'
})
}
console.log('App Launch')
try {
if (!this.$store.state.app.token) uni.redirectTo({
url: '/pages/oaLogin/oaLogin'
})
} catch (e) {
uni.redirectTo({
url: '/pages/oaLogin/oaLogin'
})
}
// jpushModule.initJPushService()
// const audioContext = uni.createInnerAudioContext()
// audioContext.src = './static/mp3/order.mp3'
// let ida = [0]
// jpushModule.addNotificationListener(function (result) {
// if (!ida.includes(result.messageID)) {
// audioContext.play()
// }
// ida.push(result.messageID)
// })
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
// jpushModule.initJPushService()
// const audioContext = uni.createInnerAudioContext()
// audioContext.src = './static/mp3/order.mp3'
// let ida = [0]
// jpushModule.addNotificationListener(function (result) {
// if (!ida.includes(result.messageID)) {
// audioContext.play()
// }
// ida.push(result.messageID)
// })
},
onShow: function () {
console.log('App Show')
//
const audioContext = uni.createInnerAudioContext()
//
audioContext.src = './static/mp3/order.mp3'
//
//#ifdef APP-PLUS
jpushModule.addNotificationListener(res => {
console.log("监听成功")
audioContext.play()
})
// #endif
},
onHide: function () {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
@import "static/css/base.css";
@import "static/css/style.scss";
/*每个页面公共css */
@import "static/css/base.css";
@import "static/css/style.scss";
view {
box-sizing: border-box;
}
view {
box-sizing: border-box;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<view class="box" v-show="flag">
<p>提示</p>
你有新的订单,请注意查收!
<view class="off" @click="flag=false ">
<u-icon name="close" color="black" size="22"></u-icon>
</view>
</view>
</template>
<script>
export default {
name: "GlobalPopup",
data() {
return {
flag: false
};
},
methods: {
showPopu() {
this.flag = true
setTimeout(() => {
this.flag = false
}, 3000)
}
}
}
</script>
<style lang="scss">
.box {
z-index: 99999999999;
position: absolute;
top: 80rpx;
width: 90vw;
text-align: center;
box-sizing: border-box;
padding: 10rpx 20rpx;
font-size: 30rpx;
height: 10vh;
background-color: white;
border-radius: 5rpx;
left: 50%;
transform: translateX(-50%);
p {
text-align: left;
font-weight: bold;
font-size: 30rpx
}
.off {
position: absolute;
right: 20rpx;
top: 10rpx;
}
}
</style>

View File

@ -12,6 +12,8 @@
<p class="tit" v-if="goodsInfo.status==2" style="background-color: #47BE62;">
收货人姓名:&nbsp;&nbsp;{{fuzzyName(goodsInfo.receiver_name)}}</p>
<p class="tit" v-if="goodsInfo.status==3" style="background-color: red;">
收货人姓名:&nbsp;&nbsp;{{fuzzyName(goodsInfo.receiver_name)}}</p>
<view class="contents">
<!-- 已取货 -->
<view class="left" v-if='goodsInfo.status==0'>
@ -215,6 +217,60 @@
</view>
<!-- 已取消 -->
<view class="left" @click="goDetil" v-if='goodsInfo.status==3'>
<view style="margin: 0;padding:0">
<view class="list">
<text>
联系电话
</text>
<view @click.stop="callFn(goodsInfo.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#47BE62" size="22"></u-icon> {{goodsInfo.receiver_phone}}
</view>
</view>
<view class="list">
<text>
用户地址
</text>
<view>
<view class="address">
{{goodsInfo.receiver_address}}
</view>
</view>
</view>
<view class="hr">
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="total">
共计{{goodsInfo.product_count}}件商品
</view>
<u-button type="primary" class="custom-style" style="background-color: red;border: 0;">
<u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button>
</view>
</view>

View File

@ -1,62 +1,65 @@
<template>
<view>
<button @click.stop="click" :class="{'my_btn_new_btn': position, 'my_btn_no_positon': !position, 'my_btn_disabled': my_btn_disabled}">{{text}}</button>
</view>
<view>
<button @click.stop="click"
:class="{'my_btn_new_btn': position, 'my_btn_no_positon': !position, 'my_btn_disabled': my_btn_disabled}">{{text}}</button>
</view>
</template>
<script>
export default {
props: {
text: {
type: String,
default: '新增'
},
position:{
type: Boolean,
default: true
},
my_btn_disabled:{
type: Boolean,
default: false
}
},
data(){
return{
}
},
methods:{
click(){
this.$emit('click')
}
}
}
export default {
props: {
text: {
type: String,
default: '新增'
},
position: {
type: Boolean,
default: true
},
my_btn_disabled: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
click() {
this.$emit('click')
}
}
}
</script>
<style lang="scss" scoped>
.my_btn_new_btn{
position: fixed;
bottom: 0;
left: 0;
// z-index: 9999999;
z-index: 1;
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.my_btn_no_positon{
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.my_btn_disabled{
background-color: #666;
color: #eee;
}
.my_btn_new_btn {
position: fixed;
bottom: 0;
left: 0;
// z-index: 9999999;
z-index: 1;
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.my_btn_no_positon {
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.my_btn_disabled {
background-color: #666;
color: #eee;
}
</style>

View File

@ -107,13 +107,13 @@
"nativePlugins" : {
"JG-JCore" : {
"JPUSH_APPKEY_ANDROID" : "5ced5ec5fa7bb86302944f0f",
"JPUSH_APPKEY_IOS" : "",
"JPUSH_APPKEY_IOS" : "5ced5ec5fa7bb86302944f0f",
"JPUSH_CHANNEL_ANDROID" : "",
"JPUSH_CHANNEL_IOS" : "",
"__plugin_info__" : {
"name" : "极光推送 JCore 官方 SDK",
"description" : "极光推送 JCore 官方 SDK HBuilder 插件版本",
"platforms" : "Android,iOS",
"platforms" : "All,Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=4028",
"android_package_name" : "uni.UNIB5B1EDD",
"ios_bundle_id" : "uni.UNIB5B1EDD",
@ -167,7 +167,7 @@
"__plugin_info__" : {
"name" : "极光推送 JPush 官方 SDK",
"description" : "极光推送JPush官方SDK HBuilder插件版本",
"platforms" : "Android,iOS",
"platforms" : "All,Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=4035",
"android_package_name" : "uni.UNIB5B1EDD",
"ios_bundle_id" : "uni.UNIB5B1EDD",

View File

@ -8,9 +8,9 @@
<u-toast ref="uToast"></u-toast>
<view class="map">
<map id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline" :markers='markers'
:scale="scale" style="width:100%;height: 70%;" :latitude="markers[0].latitude"
:enable-scroll="true" :longitude="markers[0].longitude">
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
:markers='markers' :scale="scale" style="width:100%;height: 70%;"
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
</cover-image>
</map>
@ -80,10 +80,12 @@
</view>
<view style="margin-top: 200rpx;height: 1px;">
<!-- 565 -->
</view>
<view class="btn">
<u-button @click="qrqodeFn" type="primary" class="custom-style"
style="background-color: #0122C7;border: 0;">
<u-icon name="scan" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
<u-button @click="qrqodeFn" type="primary" style="background-color: #0122C7;border: 0;">
<u-icon name="scan" color="white" size="30" style="margin-right: 10rpx;"></u-icon>
扫码取货</u-button>
</view>
</view>
@ -103,7 +105,7 @@
export default {
data() {
return {
mapClass: 'custom-map',
showLoading: true,
showPop: false,
goodsDetil: undefined,
@ -152,7 +154,7 @@
success: function async (res) {
that.nowAddress = res.address.city + res.address.district + res.address.street + res
.address.streetNum + res.address.poiName
console.log(that.nowAddress)
that.markers[1].latitude = res.latitude
that.markers[1].longitude = res.longitude
that.getDriverLine()
@ -250,7 +252,7 @@
points: points,
color: "#0091ff",
dottedLine: true,
width: 10,
width: 30,
}, ];
},
@ -286,8 +288,6 @@
})
},
},
onLoad(options) {
getDetil({
@ -306,6 +306,10 @@
</script>
<style lang='scss' scoped>
.custom-map /deep/ .polyline {
stroke-width: 20px;
}
.content {
padding: 2vh 3vw;
background-color: #F6F7FC;
@ -392,6 +396,12 @@
}
.btn {
margin-top: 200rpx;
position: fixed;
bottom: 20rpx;
width: 90vw;
left: 50%;
transform: translateX(-50%);
}
</style>

View File

@ -1,132 +1,147 @@
<template>
<view>
<!-- <globalPopup ref="globalPopup"></globalPopup> -->
<u-sticky bgColor="#0122C7" style="width: 100vw;">
<u-tabs :list="tabLists" @change="sectionChange" lineColor='#fff' :scrollable="false" lineWidth='40'
inactiveStyle='color:#fff' activeStyle="color:#fff"></u-tabs>
</u-sticky>
<view class="content">
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action='false' bg-color='white'
v-model="keywords"></u-search>
<view v-if="!orderlist.length">
<u-empty mode="data" icon="../../static/img/empty/data.png">
</u-empty>
</view>
<view v-else>
<logistiCard ref="logistiCards" v-for='(item,index) in orderlist' @getlist="getOrderList"
@showTost='showToast' @showToast2="showToast2" :goodsInfo="item" :key="index">
</logistiCard>
</view>
<!-- -->
<u-toast ref="uToast"></u-toast>
</view>
</view>
<view>
<globalPopup ref="globalPopup"></globalPopup>
<u-sticky bgColor="#0122C7" style="width: 100vw">
<u-tabs
:list="tabLists"
@change="sectionChange"
lineColor="#fff"
:scrollable="false"
lineWidth="40"
inactiveStyle="color:#fff"
activeStyle="color:#fff"
></u-tabs>
</u-sticky>
<view class="content">
<u-search
placeholder="搜索你的订单"
@search="getOrderList"
:show-action="false"
bg-color="white"
v-model="keywords"
></u-search>
<view v-if="!orderlist.length">
<u-empty mode="data" icon="../../static/img/empty/data.png"> </u-empty>
</view>
<view v-else>
<logistiCard
ref="logistiCards"
v-for="(item, index) in orderlist"
@getlist="getOrderList"
@showTost="showToast"
@showToast2="showToast2"
:goodsInfo="item"
:key="index"
>
</logistiCard>
</view>
<!-- -->
<u-toast ref="uToast"></u-toast>
</view>
</view>
</template>
<script>
import {
getList
} from "@/api/logistics.js"
// import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
import {
informationAdd
} from "@/api/logistics.js"
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
components: {
logistiCard,
// globalPopup
},
data() {
return {
notArr: [],
keywords: "",
tabLists: [{
name: '待配送',
}, {
name: '待送达'
}, {
name: '已送达'
}],
curNow: 0,
orderlist: []
}
},
methods: {
go() {
uni.navigateTo({
url: "/pages/logistics/te"
})
},
sectionChange(index) {
import {
getList
} from "@/api/logistics.js"
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
import {
informationAdd
} from "@/api/logistics.js"
import logistiCard from "@/components/logistiComptent/logistiCard/logistiCard.vue"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
export default {
components: {
logistiCard,
globalPopup
},
data () {
return {
notArr: [],
keywords: "",
tabLists: [{
name: '待配送',
}, {
name: '待送达'
}, {
name: '已送达'
}],
curNow: 0,
orderlist: []
}
},
methods: {
go () {
uni.navigateTo({
url: "/pages/logistics/te"
})
},
sectionChange (index) {
this.curNow = index.index;
this.getOrderList()
},
this.curNow = index.index;
this.getOrderList()
},
showToast() {
// 6
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
showToast2() {
// 6
showToast () {
// 6
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
showToast2 () {
// 6
this.$refs.uToast.show({
type: 'error',
message: "取件码不能为空",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
}, )
},
getOrderList() {
console.log("列表更新")
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
getList({
status: this.curNow,
courier_id: id,
keywords: this.keywords
}).then(res => {
this.orderlist = []
this.orderlist = res.data.data
})
}
this.$refs.uToast.show({
type: 'error',
message: "取件码不能为空",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
},)
},
getOrderList () {
console.log("列表更新")
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
getList({
status: this.curNow,
courier_id: id,
keywords: this.keywords
}).then(res => {
this.orderlist = []
this.orderlist = res.data.data
})
}
},
onLoad() {
let that = this
//#ifdef APP-PLUS
jpushModule.addNotificationListener(function(result) {
if (!that.notArr.includes(result.messageID)) {
that.$refs.globalPopup.showPopu();
that.getOrderList()
},
onLoad () {
let that = this
//#ifdef APP-PLUS
jpushModule.addNotificationListener(function (result) {
if (!that.notArr.includes(result.messageID)) {
that.$refs.globalPopup.showPopu();
that.getOrderList()
}
that.notArr.push(result.messageID)
})
// #endif
},
onShow() {
this.getOrderList()
}
that.notArr.push(result.messageID)
})
// #endif
},
onShow () {
this.getOrderList()
}
}
}
}
</script>
<style lang='scss'>
.content {
margin-top: 2vh;
background-color: #F5F5F5;
padding: 0vh 2vw;
}
.content {
margin-top: 2vh;
background-color: #f5f5f5;
padding: 0vh 2vw;
}
</style>

View File

@ -11,7 +11,83 @@
</p>
<p class="tit" v-if="goodsDetil.logistics.status==2" style="background-color: #47BE62;">
订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</p>
<p class="tit" v-if="goodsDetil.logistics.status==3" style="background-color: red;">
订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</p>
<view class="contents">
<!-- 已取消 -->
<view class="left" v-if="goodsDetil.logistics.status==3">
<view class="list">
<text>
取消时间
</text>
<view>
{{goodsDetil.record[1].create_time}}
</view>
</view>
<view class="list">
<text>
收货详情
</text>
<view>
<view>
{{goodsDetil.logistics.receiver_address}}
</view>
<view>
{{ fuzzyName(goodsDetil.logistics.receiver_name) ||"顾客姓名"}}:&nbsp;&nbsp;{{goodsDetil.logistics.receiver_phone||"顾客电话"}}
</view>
<view>
{{goodsDetil.create_time}}
</view>
</view>
</view>
<view class="list">
<text>
取货详情
</text>
<view>
<view>
{{goodsDetil.logistics.shop_address||"商家地址"}}
</view>
<view>
{{goodsDetil.logistics.shop_name||"商家电话"}}
:&nbsp;&nbsp;{{goodsDetil.logistics.shop_phone||"商家电话"}}
</view>
</view>
</view>
<view class="hr">
</view>
<view>
<view>
物流信息
</view>
<view style="margin: 10rpx 0;">
<u-steps :current="record.length" direction="column">
<u-steps-item :title="item.content" :desc="item.create_time"
v-for="(item,index) in goodsDetil.record">
</u-steps-item>
</u-steps>
</view>
</view>
<view class="pro_list">
<text style="width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<!-- 已送达 -->
<view class="left" v-if="goodsDetil.logistics.status==2">
<view class="list">
@ -86,8 +162,8 @@
</view>
<!-- 已取货 -->
<view class="left" v-else>
<view class="list">
<view class="left" v-if="goodsDetil.logistics.status==1">
<view class=" list">
<text>
用户名称
</text>
@ -145,12 +221,10 @@
</view>
<view class="total" v-if="goodsDetil.logistics.status==2">
<view class="total" v-if="goodsDetil.logistics.status==2||goodsDetil.logistics.status==3">
<text>共计{{goodsDetil.product_count}} </text>
</view>
<view style="margin-top: 600rpx;" v-if="goodsDetil.logistics.status==1">
<view class="btn" v-if="goodsDetil.logistics.status==1">
<u-button type="primary" style="background-color: #FF7C32;border: 0; border-radius: 2vw;"
@click="showPop=true"><u-icon name="car-fill" color="white" size="25"
style="margin-right: 10rpx;;"></u-icon>
@ -254,6 +328,15 @@
background-color: #F5F5F5;
}
.btn {
position: fixed;
bottom: 20rpx;
width: 90vw;
left: 50%;
transform: translateX(-50%);
}
.order {
position: relative;
background-color: white;

File diff suppressed because it is too large Load Diff

View File

@ -21,12 +21,14 @@
</view>
<input
v-if="current == 0"
@click="getId"
class="mobile item"
v-model="formData.account"
placeholder="输入账号"
/>
<input
v-if="current == 0"
@click="getId"
class="mobile item"
v-model="formData.password"
maxlength="26"
@ -108,6 +110,19 @@ export default {
this.current = e.index;
this.formData.scene = e.index + 1;
},
// id
getId () {
// #ifdef APP-PLUS
if (this.formData.register_id) return
jpushModule.initJPushService()
jpushModule.getRegistrationID(result => {
// id
this.formData.register_id = result.registerID || 0
console.log("设备----", this.formData)
})
// #endif
},
async login () {
if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
@ -124,25 +139,14 @@ export default {
user: data,
token: res.data.token
})
let { data } = await userInfo();
let {
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
uni.hideLoading()
if (data.is_new_user) {
uni.showLoading({
mask: true,
title: '加载中'
})
uni.switchTab({
url: '/pages/oaHome/oaHome',
success: () => {
uni.$emit('initOaTask'); //
uni.hideLoading()
}
})
} else uni.navigateTo({
url: '/pages/updatePasswprd/updatePasswprd'
});
uni.switchTab({
url: '/pages/oaHome/oaHome'
})
},
initTerminal () {
// #ifndef APP-PLUS
@ -199,14 +203,7 @@ export default {
}
},
mounted () {
// // #ifdef APP-PLUS
// jpushModule.initJPushService()
// jpushModule.getRegistrationID(result => {
// // id
// this.formData.register_id = result.registerID
// console.log("----", this.formData)
// })
// // #endif
this.initTerminal();
}

View File

@ -1,6 +1,6 @@
// 引用方式
var jpushModule = uni.requireNativePlugin("JG-JPush");
console.log('【sk】【引用方式】【jpushModule】【requireNativePlugin】')
// console.log('【sk】【引用方式】【jpushModule】【requireNativePlugin】')
// 开启 debug 模式,默认是关闭
function openDebug() {