[fix]版本更新

main
huyuanxiang 2 years ago
parent e9fc2bafb8
commit 8c8d55a4d7

1
.gitignore vendored

@ -9,6 +9,7 @@
# Local History for Visual Studio Code # Local History for Visual Studio Code
.history/ .history/
unpackage/ unpackage/
node_modules/
*.app *.app
.snapshots/* .snapshots/*

@ -10,6 +10,8 @@ export const addOrder = (params) => request('/erp/order/add', params, 'post')
export const editOrder = (params) => request('/erp/order/edit', params, 'post') export const editOrder = (params) => request('/erp/order/edit', params, 'post')
export const getStatusList = (params) => request('/erp/order/queryState', params, 'get') export const getStatusList = (params) => request('/erp/order/queryState', params, 'get')
export const getStoreList = (params) => request('/erp/storeInfo/list', params, 'get')
export const getAddrList = (params) => request('/erp/addrManager/list', params, 'get') export const getAddrList = (params) => request('/erp/addrManager/list', params, 'get')
export const addAddr = (params) => request('/erp/addrManager/add', params, 'post') export const addAddr = (params) => request('/erp/addrManager/add', params, 'post')
export const editAddr = (params) => request('/erp/addrManager/edit', params, 'post') export const editAddr = (params) => request('/erp/addrManager/edit', params, 'post')

@ -1,6 +1,9 @@
const isPro = true const isPro = true
const BASE_API_URL = isPro ?
'http://store-admin.nhet.cloud:8080/jeecg-boot' :
'http://47.100.35.222:8080/jeecg-boot';
export default { export default {
imgUrl: 'http://store-admin.nhet.cloud:8080/jeecg-boot/sys/common/static/', imgUrl: BASE_API_URL + '/sys/common/static/',
apiUrl: isPro ? 'http://store-admin.nhet.cloud:8080/jeecg-boot' : 'http://store-admin.nhet.cloud:8080/jeecg-boot', apiUrl: BASE_API_URL,
isPro isPro
} }

@ -3,7 +3,13 @@ export const ORDER_NAVS = [
name: '全部', name: '全部',
icon: 'icon-daifukuan', icon: 'icon-daifukuan',
url: '', url: '',
id: -1 id: -2
},
{
name: '待确认',
icon: 'icon-liebiao',
url: '',
id: 6
}, },
{ {
name: '待支付', name: '待支付',
@ -11,22 +17,22 @@ export const ORDER_NAVS = [
url: '', url: '',
id: 0 id: 0
}, { }, {
name: '待货', name: '待货',
icon: 'icon-daifahuo', icon: 'icon-daifahuo',
url: '', url: '',
id: 1 id: 1
}, { }, {
name: '待收货', name: '已提货',
icon: 'icon-daishouhuo1', icon: 'icon-daishouhuo1',
url: '', url: '',
id: 2 id: 2
}, },
{ // {
name: '已收货', // name: '已收货',
icon: 'icon-daipingjia', // icon: 'icon-daipingjia',
url: '', // url: '',
id: 3 // id: 3
}, // },
{ {
name: '已取消', name: '已取消',
icon: 'icon-erji', icon: 'icon-erji',

@ -3,10 +3,10 @@ import App from './App';
import nodata from "./pages/commponent/public/nodata"; import nodata from "./pages/commponent/public/nodata";
import request from 'utils/request.js' //引入异步请求函数 import request from 'utils/request.js' //引入异步请求函数
import {toast} from './utils/util' import {toast} from './utils/util'
// import './utils/noprint.js' import signature from '@jensonhui/signature-h5'
import json from './json' //测试用数据 import '@jensonhui/signature-h5/lib/signatureH5.css';
Vue.use(signature)
Vue.prototype.request = request.request //挂载到全局 Vue.prototype.request = request.request //挂载到全局
Vue.prototype.$toast = toast //挂载到全局 Vue.prototype.$toast = toast //挂载到全局
Vue.component("nodata", nodata); Vue.component("nodata", nodata);

@ -1,6 +1,19 @@
{ {
"dependencies": { "dependencies": {
"@jensonhui/signature-h5": "^1.0.5"
}, },
"devDependencies": { "devDependencies": {},
} "name": "nherp-shop",
"description": "t",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://gitea.nhet.cloud/huyuanxiang/nherp-shop.git"
},
"author": "",
"license": "ISC"
} }

@ -71,6 +71,12 @@
"navigationBarTitleText": "设置" "navigationBarTitleText": "设置"
} }
}, },
{
"path": "pages/views/poster/signature",
"style": {
"navigationBarTitleText": "签名"
}
},
{ {
"path": "pages/views/home/classList", "path": "pages/views/home/classList",
"style": { "style": {
@ -147,7 +153,7 @@
{ {
"path": "pages/views/user/myaddress", "path": "pages/views/user/myaddress",
"style": { "style": {
"navigationBarTitleText": "货地址", "navigationBarTitleText": "货地址",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"app-plus": { "app-plus": {
"bounce": "none" "bounce": "none"

@ -1,6 +1,6 @@
<template> <template>
<view class="my_order"> <view class="my_order">
<list-cell icons="icon-order" linkUrl="/pages/views/order/orderList" :colors="colors">全部订单</list-cell> <list-cell icons="icon-order" linkUrl="/pages/views/order/orderList?tabIndex=0" :colors="colors">全部订单</list-cell>
<view class="order_btnbox"> <view class="order_btnbox">
<view v-for="(item, index) in orderText" :key="index" class="order_btns" @tap="jumpOrder(item,index)"> <view v-for="(item, index) in orderText" :key="index" class="order_btns" @tap="jumpOrder(item,index)">
<view> <view>
@ -33,17 +33,11 @@ export default {
}, },
methods: { methods: {
jumpOrder(item,index) { jumpOrder(item,index) {
if(item.url !== ''){
uni.navigateTo({
url: item.url
});
}else{
uni.navigateTo({ uni.navigateTo({
url: '/pages/views/order/orderList?tabIndex=' + (index + 1) url: '/pages/views/order/orderList?tabIndex=' + (index + 1)
}); });
} }
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -17,14 +17,14 @@
<block v-if="address"> <block v-if="address">
<view class="center"> <view class="center">
<view class="name"> <view class="name">
<text class="text1">{{address.recipient}}</text> <text class="text1">{{address.name}}</text>
<text class="phones">{{address.telephone}}</text> <text class="phones">{{address.phone}}</text>
</view> </view>
<view class="address_name">{{address.detail}}</view> <view class="address_name">{{address.addr}}</view>
</view> </view>
</block> </block>
<view class="noaddress" v-else> <view class="noaddress" v-else>
添加收货地址 就近选择提货地址
</view> </view>
</view> </view>
</view> </view>
@ -125,7 +125,7 @@ export default {
return { return {
couponshow: false, couponshow: false,
modes: '物流寄送', modes: '现场提货',
tapIndex: 0, tapIndex: 0,
goodsList:getGoodsData(), goodsList:getGoodsData(),
couponIndex: 0, couponIndex: 0,
@ -241,13 +241,13 @@ export default {
} }
const cartList = getCart() const cartList = getCart()
const goodsIds = this.goodsList.map(v => v.id) const goodsIds = this.goodsList.map(v => v.id)
const newCartList = cartList.filter(v => !goodsIds.includes(v.id)) const newCartList = cartList.filter(v => !goodsIds.includes(v.id))
const userInfo = getUserInfo()
const params = { const params = {
"recipient": this.address.recipient, storeId: this.address.id,
"addr": this.address.detail, "recipient": userInfo.realname,
"mobile": this.address.telephone, "addr": this.address.addr,
"mobile": userInfo.phone,
"orderDetailList": this.goodsList.map(v => { "orderDetailList": this.goodsList.map(v => {
return { return {
goodsId: v.id, goodsId: v.id,
@ -256,12 +256,10 @@ export default {
price: v.price price: v.price
} }
}), }),
state: 0, state: 6,
"remark": this.remark, "remark": this.remark,
"totalAmount": this.sumprice, "totalAmount": this.sumprice,
"userId": userInfo.id
"userId": getUserInfo().id
} }
if (this.isConfirm) return if (this.isConfirm) return
this.isConfirm = true this.isConfirm = true

@ -11,10 +11,10 @@
<block> <block>
<view class="center"> <view class="center">
<view class="name"> <view class="name">
<text class="text1">{{ goods.recipient }}</text> <text class="text1">{{ goods.storeName }}</text>
<text class="phones">{{ goods.mobile }}</text> <text class="phones">{{ goods.storePhone }}</text>
</view> </view>
<view class="address_name">{{ goods.addr.split(',')[0] }}{{ goods.addr.split(',')[1] }}</view> <view class="address_name">{{ goods.storeAddr }}</view>
</view> </view>
</block> </block>
</view> </view>
@ -48,7 +48,7 @@
</view> --> </view> -->
</view> </view>
<!-- 单商品操作按钮 在订单状态为待评价时才会显示--> <!-- 单商品操作按钮 在订单状态为待评价时才会显示-->
<view class="goods_btns" v-if="goods.state === 3"> <view class="goods_btns" v-if="goods.state === 2 || goods.state === 3">
<view class="btns" style="margin-right: 40upx;" @click="onafterSale(item)"> <view class="btns" style="margin-right: 40upx;" @click="onafterSale(item)">
申请售后 申请售后
</view> </view>
@ -109,8 +109,14 @@
{{ goods.createTime }} {{ goods.createTime }}
</view> </view>
</view> </view>
<view class="tips margin0" v-if="goods.dispacherRemark || goods.financeRemark"> <view class="tips margin0" v-if="goods.dispacherRemark || goods.financeRemark || goods.materialRemark">
<view class="tips_name">退单原因</view> <view class="tips_name">退单原因</view>
<view class="textarea_box" v-if="goods.materialRemark">
<textarea disabled="true" placeholder-class="font-size: 24upx" maxlength="-1"
v-model="goods.materialRemark">
</textarea>
</view>
<view class="textarea_box" v-if="goods.dispacherRemark"> <view class="textarea_box" v-if="goods.dispacherRemark">
<textarea disabled="true" placeholder-class="font-size: 24upx" maxlength="-1" <textarea disabled="true" placeholder-class="font-size: 24upx" maxlength="-1"
v-model="goods.dispacherRemark"> v-model="goods.dispacherRemark">
@ -132,8 +138,12 @@
</view> </view>
</view> </view>
<view class="bottom_btn" > <view class="bottom_btn" v-if="goods.state == 0
<block v-if="goods.state == 0"> || goods.state == 6
|| goods.state == 1
">
<block v-if="goods.state == 0
|| goods.state == 6">
<view class="moneys"> <view class="moneys">
合计: <text >{{goods.totalAmount}}</text> 合计: <text >{{goods.totalAmount}}</text>
</view> </view>
@ -150,17 +160,16 @@
申请退款 申请退款
</view> </view>
</block> --> </block> -->
<block v-if="goods.state == 2"> <block v-if="goods.state == 1">
<!-- <view class="btns" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" @tap="onRefund"> <!-- <view class="btns" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" @tap="onRefund">
申请退款 申请退款
</view> --> </view> -->
<view class="btns" <view class="btns"
@tap="changeOrderStatus(goods.state, 'ok')" @tap="changeOrderStatus(goods.state, 'ok')">
:style="'background:' + colors + ';'">
确认收货 确认收货
</view> </view>
</block> </block>
<block v-if="goods.state == 3"> <block v-if="goods.state == 2 || goods.state == 3">
<!-- <view class="btns shouhou" @click="jumpSale">退/</view> --> <!-- <view class="btns shouhou" @click="jumpSale">退/</view> -->
<!-- <view class="btns" :style="'background:' + colors + ';margin-left:20upx;'">再次购买</view> --> <!-- <view class="btns" :style="'background:' + colors + ';margin-left:20upx;'">再次购买</view> -->
<view class="btns shouhou" @tap="onafterSale">退/</view> <view class="btns shouhou" @tap="onafterSale">退/</view>
@ -344,6 +353,7 @@ export default {
}, },
changeOrderStatus(state, type = 'ok') { changeOrderStatus(state, type = 'ok') {
console.log(state)
const stateObj = { const stateObj = {
0: { 0: {
okState: 1, okState: 1,
@ -351,9 +361,15 @@ export default {
cancelText: '是否取消该订单吗?', cancelText: '是否取消该订单吗?',
cancelState: 5, cancelState: 5,
}, },
2: { 6: {
okState: 1,
okText: '',
cancelText: '是否取消该订单吗?',
cancelState: 5,
},
1: {
okText: '是否确认收货?', okText: '是否确认收货?',
okState: 3, okState: 2,
cancelText: '', cancelText: '',
} }

@ -12,13 +12,22 @@
</view> </view>
<!-- 占位 --> <!-- 占位 -->
<view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view> <view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view>
<scroll-view scroll-y="true" style="height: calc(100vh - 90px)"
@scrolltolower="handleLoadMore">
<view class="list_box"> <view class="list_box">
<view v-for="(item, index) in orderList" :key="index" class="lists"> <view v-for="(item, index) in orderList" :key="index" class="lists">
<view class="type"> <view class="type">
<text class="order_id">订单编号:{{item.id}}</text> <text class="order_id" @tap="jumpDetails(item)">:{{item.id}}</text>
<view class="flex flex-direction">
<text class="order_type"> <text class="order_type">
{{ item.state | setStatus }} {{ item.state | setStatus }}
</text> </text>
<text class="order-time" v-if="item.time != 0">{{ item.time }}</text>
</view>
</view>
<view>
</view> </view>
<view v-for="(row, index2) in item.orderDetailList" :key="index2" class="top" <view v-for="(row, index2) in item.orderDetailList" :key="index2" class="top"
@tap="jumpDetails(item)"> @tap="jumpDetails(item)">
@ -38,16 +47,19 @@
<view class="address">总计<text style="color: #FF1929;font-size: 36upx;">{{item.totalAmount}}</text> </view> <view class="address">总计<text style="color: #FF1929;font-size: 36upx;">{{item.totalAmount}}</text> </view>
<!-- <view class="address">店铺地址北京市海淀区苏家坨乡前沙涧村</view> --> <!-- <view class="address">店铺地址北京市海淀区苏家坨乡前沙涧村</view> -->
<view class="btns"> <view class="btns">
<block v-if="item.state == 0"> <block v-if="item.state == 0 || item.state == 6">
<!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)"></view> --> <!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)"></view> -->
<view class="pay shouhou" @tap="cencalOrder(item)"></view> <view class="pay shouhou" @tap="cencalOrder(item)"></view>
</block> </block>
<block v-if="item.state == 1"> <block v-if="item.state == 1">
<!-- <view class="pay shouhou" @tap="onRefund(item)"></view> --> <!-- <view class="pay shouhou" @tap="onRefund(item)"></view> -->
<view class="pay shouhou" @tap="onConfirmOrder(item)" >确认提货</view>
</block> </block>
<block v-if="item.state == 2"> <block v-if="item.state == 2">
<view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view> <!-- <view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view> -->
<!-- <view class="pay shouhou" @tap="onRefund(item)">退</view> --> <!-- <view class="pay shouhou" @tap="onRefund(item)">退</view> -->
<view class="pay shouhou" @tap="jumpDetails(item)"></view>
<view class="pay shouhou" @tap="jumpDetails(item)"></view>
</block> </block>
<block v-if="item.state == 3"> <block v-if="item.state == 3">
<view class="pay shouhou" @tap="jumpDetails(item)"></view> <view class="pay shouhou" @tap="jumpDetails(item)"></view>
@ -58,9 +70,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="nodata" v-if="orderList.length >= 3"> </view> <view class="nodata" v-if="isNoMore"> </view>
<nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata> <nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata>
</view> </view>
</scroll-view>
</view> </view>
<loading v-if="isShow == true"></loading> <loading v-if="isShow == true"></loading>
</view> </view>
@ -75,6 +88,7 @@
import { ORDER_NAVS } from '@/config/order.js' import { ORDER_NAVS } from '@/config/order.js'
import { getUserInfo, setSalesGoods } from '@/utils/auth'; import { getUserInfo, setSalesGoods } from '@/utils/auth';
const app = getApp(); const app = getApp();
let timer = null
export default { export default {
data() { data() {
return { return {
@ -85,26 +99,24 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
orderList: [], orderList: [],
isShow: true, isShow: true,
colors: "", colors: "",
themeObj: app.globalData.themeObj themeObj: app.globalData.themeObj,
pageNo: 1,
pageSize: 10,
isNoMore: false
}; };
}, },
filters: { filters: {
setStatus(value) { setStatus(value) {
if (value == 0) { const textObj = {
return '待付款' 6: '待确认',
} else if (value == 1) { 0: '待付款',
return '待发货' 1: '待提货',
} else if (value == 2) { 2: '已提货',
return '待收货' 3: '已提货',
} else if (value == 3) { 4: '退换货',
return '已收货' 5: '已取消'
}
else if (value == 4) {
return '退换'
}
else if (value == 5) {
return '已取消'
} }
return textObj[value] || '未知'
} }
}, },
components: { components: {
@ -118,15 +130,11 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
if (options.tabIndex) { if (options.tabIndex) {
this.setData({ this.active = Number(options.tabIndex)
active: Number(options.tabIndex) this.getOrderList(ORDER_NAVS[this.active].id)
});
} }
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
isShow: false isShow: false
@ -144,7 +152,8 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {
this.getOrderList(ORDER_NAVS[this.active].id)
// this.getOrderList(ORDER_NAVS[this.active].id)
}, },
/** /**
@ -172,18 +181,26 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
*/ */
onShareAppMessage: function() {}, onShareAppMessage: function() {},
methods: { methods: {
handleLoadMore() {
if (this.isNoMore) return
this.pageNo++
this.getOrderList(ORDER_NAVS[this.active].id)
},
onConfirmOrder(item) { onConfirmOrder(item) {
uni.showModal({ uni.showModal({
title:'是否确认收货?', title:'是否确认货?',
confirmColor:this.colors, confirmColor: this.themeObj.color,
success: (res) => { success: (res) => {
if(res.confirm){ if(res.confirm){
item.state = 3 item.state = 2
editOrder(item).then(res => { editOrder(item).then(res => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功'
}) })
this.orderList = []
this.isNoMore = false
this.pageNo = 1
this.getOrderList(ORDER_NAVS[this.active].id) this.getOrderList(ORDER_NAVS[this.active].id)
}) })
@ -191,45 +208,97 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
} }
}) })
}, },
// 0 1 2 3 4 退 . -1 // 0 -1 1 2 3 4 退 . -1
getOrderList(val = -1) { getOrderList(val = -2) {
let s = [ let s = [
{ {
"rule": "eq", "rule": "eq",
"type": "int", "type": "string",
"dictCode": "", "dictCode": "",
"val": getUserInfo().id, "val": getUserInfo().id,
"field": "userId" "field": "userId"
} }
] ]
s = val !== -1 ? [...s, { const stateQuery = {
"rule": "eq", "rule": "eq",
"type": "string", "type": "int",
"dictCode": "", "dictCode": "orderState",
"val": val, "val": val,
"field": "state" "field": "state"
}] : s }
if (val !== -2) {
stateQuery.val = val === 2 ? '2,3,4' : val
stateQuery.rule = val === 2 ? 'in' : 'eq'
s = [...s, stateQuery]
}
const params = { const params = {
pageNo:1, pageNo: this.pageNo,
pageSize: 100, pageSize: this.pageSize,
superQueryParams: s, superQueryParams: s,
superQueryMatchType: 'and', superQueryMatchType: 'and',
"column": "createTime", "column": "createTime",
order: "desc", order: "desc",
} }
uni.showLoading()
params.superQueryParams = encodeURI(JSON.stringify(s)) params.superQueryParams = encodeURI(JSON.stringify(s))
clearInterval(timer)
getOrderList(params).then(res => { getOrderList(params).then(res => {
const result = res.result.records const result = [...this.orderList, ...res.result.records]
this.orderList = result this.isNoMore = res.result.records.length < this.pageSize
if (val == 0 || val == -2) {
this.time(result)
} else {
this.orderList = Object.freeze(result)
uni.hideLoading()
}
}).catch(() => {
uni.hideLoading()
}) })
}, },
time (arr) {
var self = this;
timer = setInterval(() => {
const list = arr.map((v, i) => {
if (v.state !== 0) {
v.time = 0
return v
}
var nowDate = new Date();
const endTime = new Date(v.createTime).getTime() + 48 * 60 * 60 * 1000
var seconds = parseInt((endTime - nowDate) / 1000);
if (seconds <= 0) {
this.handlerCancelOrder(v, 'time')
return v;
}
var hours = Math.floor(seconds / (60 * 60));
if (hours < 10) hours = "0" + hours;
seconds = seconds % (60 * 60);
var mins = Math.floor(seconds / 60);
if (mins < 10) mins = "0" + mins;
seconds = seconds % 60;
if (seconds < 10) seconds = "0" + seconds;
v.time = hours + ":" + mins + ":" + seconds
return v
})
this.orderList = Object.freeze(list)
}, 1000);
uni.hideLoading()
},
setTabs(item, index) { setTabs(item, index) {
this.setData({ this.setData({
active: index active: index
}); });
this.orderList = []
this.isNoMore = false
this.pageNo = 1
this.getOrderList(item.id) this.getOrderList(item.id)
}, },
@ -239,22 +308,29 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
url: '/pages/views/order/orderDetails?status='+ 3 url: '/pages/views/order/orderDetails?status='+ 3
}); });
}, },
cencalOrder(item) { handlerCancelOrder(item, type = 'init') {
//
uni.showModal({
title:'确认要取消该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
item.state = 5 item.state = 5
editOrder(item).then(res => { editOrder(item).then(res => {
if (type === 'init') {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功'
}) })
}
this.orderList = []
this.isNoMore = false
this.pageNo = 1
this.getOrderList(ORDER_NAVS[this.active].id) this.getOrderList(ORDER_NAVS[this.active].id)
}) })
console.log('取消成功') },
cencalOrder(item) {
//
uni.showModal({
title:'确认要取消该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
this.handlerCancelOrder(item)
} }
} }
}) })
@ -323,7 +399,7 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
.type { .type {
height: 50upx; height: 50upx;
font-size: 26upx; font-size: 26upx;
line-height: 50upx; // line-height: 50upx;
font-weight: bold; font-weight: bold;
text-align: right; text-align: right;
display: flex; display: flex;
@ -335,6 +411,10 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
color: #999; color: #999;
font-size: 24upx; font-size: 24upx;
} }
.type .order-time {
color: brown;
font-size: 24upx;
}
.lists .top { .lists .top {
display: flex; display: flex;

@ -0,0 +1,62 @@
<template>
<signatureH5
:options="options" >
<template v-slot:default="{ signatrue }">
<div class="btn-box flex-row">
<span class="del-btn" @click="clearHandle(signatrue)"></span>
<span class="sure-btn" @click="confirmHandle(signatrue)"></span>
</div>
</template>
</signatureH5>
</template>
<script>
import { rotateBase64Img } from '@/utils/util.js'
export default {
data() {
return {
options: {
// minWidth: 5,
// maxWidth: 10,
penColor: "rgb(66, 133, 244)"
}
}
},
onShow() {
},
methods: {
confirm(data) {
console.log(data)
},
clearHandle(canvasNode) {
if (canvasNode) {
canvasNode.clear()
}
},
confirmHandle(canvasNode) {
if (!canvasNode) {
return
}
//
if (canvasNode.isEmpty()) {
console.warn('您还没有签名');
this.$toast('您还没有签名')
return false
}
//
const _boxWidth = window.innerWidth
const _boxHeight = window.innerHeight
const _signImg = canvasNode.toDataURL('image/png', 0.6) || null
if (_boxWidth < _boxHeight) {
rotateBase64Img(_signImg, -90, (imgUrlRes) => {
console.log(imgUrlRes)
})
}
}
}
}
</script>
<style>
</style>

@ -87,13 +87,15 @@ export default {
url: '/pages/views/user/mycollection', url: '/pages/views/user/mycollection',
id: 1, id: 1,
elseUrl: '' elseUrl: ''
}, { },
name: '地址管理', // {
icon: 'icon-dizhi', // name: '',
url: '/pages/views/user/myaddress', // icon: 'icon-dizhi',
id: 2, // url: '/pages/views/user/myaddress',
elseUrl: '' // id: 2,
},{ // elseUrl: ''
// },
{
name: '分销中心', name: '分销中心',
icon: 'icon-fenxiao', icon: 'icon-fenxiao',
url: '/pages/views/user/mydistribution', url: '/pages/views/user/mydistribution',
@ -206,15 +208,16 @@ export default {
getStatusList({userId: getUserInfo().id}).then(res => { getStatusList({userId: getUserInfo().id}).then(res => {
const result = res.result const result = res.result
const obj = { const obj = {
'state6': result.unconfirmed,
state0: result.unpaid, state0: result.unpaid,
state1: result.notSend, state1: result.notSend,
state2: result.send, // state2: result.send,
// state3: result.complete, // state3: result.complete,
// state4: result.other, // state4: result.other,
// state5: result.cancel, // state5: result.cancel,
} }
const navs = ORDER_NAVS.slice(1).map((v, index) => { const navs = ORDER_NAVS.slice(1).map((v, index) => {
v._num = obj['state' + v.id] || 0 v._num = obj['state' + (v.id + '')] || 0
return v return v
}) })
this.orderText = navs this.orderText = navs

@ -9,33 +9,33 @@
<view @click="onsetAddress(item)"> <view @click="onsetAddress(item)">
<view class="center"> <view class="center">
<!-- v-if="item.isDefault == 1" --> <!-- v-if="item.isDefault == 1" -->
<view class="moren"> <!-- <view class="moren">
<text class="iconfont icon-moren"></text> <text class="iconfont icon-moren"></text>
</view> </view> -->
<view class="name"> <view class="name">
<text class="text1">{{item.recipient}}</text> <text class="text1">{{item.contacts}}</text>
<text class="phones">{{item.telephone}}</text> <text class="phones">{{item.phone}}</text>
</view> </view>
<view class="address_name">{{item.detail.split(',').join('')}}</view> <view class="address_name">{{item.addr}}</view>
</view> </view>
</view> </view>
<view class="caozuo"> <view class="caozuo">
<view class="del" @tap="delAddress(item,index)"> <!-- <view class="del" @tap="delAddress(item,index)">
<text class="iconfont icon-shanchu"></text> <text class="iconfont icon-shanchu"></text>
删除 删除
</view> </view>
<view class="edit" @tap="editAddress(item)"> <view class="edit" @tap="editAddress(item)">
<text class="iconfont icon-bianji"></text> <text class="iconfont icon-bianji"></text>
编辑 编辑
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
<nodata :colors="colors" title="暂无货地址" v-if="addressList.length == 0"></nodata> <nodata :colors="colors" title="暂无货地址" v-if="addressList.length == 0"></nodata>
</view> </view>
<view class="save"> <view class="save">
<view class="btn" @tap="addAddress"></view> <!-- <view class="btn" @tap="addAddress"></view> -->
</view> </view>
<loading v-if="isShow == true"></loading> <loading v-if="isShow == true"></loading>
</view> </view>
@ -43,7 +43,7 @@
<script> <script>
import { getAddrList, delAddr } from '@/api/index.js' import { getAddrList, delAddr, getStoreList } from '@/api/index.js'
import loading from "../../commponent/public/loading"; import loading from "../../commponent/public/loading";
import { import {
getUserInfo, getUserInfo,
@ -122,22 +122,24 @@
methods: { methods: {
getAddrList() { getAddrList() {
const s = [ const s = [
{ // {
"rule": "eq", // "rule": "eq",
"type": "string", // "type": "string",
"dictCode": "", // "dictCode": "",
"val": getUserInfo().id, // "val": getUserInfo().id,
"field": "userId" // "field": "userId"
} // }
] ]
const params = { const params = {
pageNo:1, pageNo:1,
pageSize: 10, pageSize: 100,
superQueryParams: encodeURI(JSON.stringify(s)), superQueryParams: encodeURI(JSON.stringify(s)),
superQueryMatchType: 'and' superQueryMatchType: 'and'
} }
getAddrList(params).then(res => { uni.showLoading()
getStoreList(params).then(res => {
this.addressList = res.result.records this.addressList = res.result.records
uni.hideLoading()
}) })
}, },

@ -33,6 +33,8 @@ async function request(method, params, type = 'GET') {
}; };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request(http).then(res => { uni.request(http).then(res => {
uni.hideLoading()
console.log(res)
let newData = res[1].data; // if (newdata.code == 403) { let newData = res[1].data; // if (newdata.code == 403) {
if (newData == -1) { if (newData == -1) {
//如果错误码为 -1 提示 //如果错误码为 -1 提示
@ -41,8 +43,30 @@ async function request(method, params, type = 'GET') {
icon: 'none' icon: 'none'
}); });
} }
resolve(res[1].data); if (newData.code !== 200) {
if (newData.code === 401) {
uni.showToast({
title: newData.message,
icon: 'none'
});
uni.removeStorageSync('userinfo')
uni.removeStorageSync('token')
setTimeout(() => {
uni.redirectTo({
url: '/pages/login/index1'
})
}, 500)
} else {
uni.showToast({
title: newData.message,
icon: 'none'
});
}
reject(newData);
}
resolve(newData);
}).catch(err => { }).catch(err => {
uni.hideLoading()
if (err.statusCode === 401) { if (err.statusCode === 401) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/login/index1?status=' + 1 url: '/pages/login/index1?status=' + 1

@ -64,3 +64,103 @@ export const debounce = (() => {
timer = setTimeout(callback, wait) timer = setTimeout(callback, wait)
} }
})(); })();
// 图片旋转处理 => output(base64)
export const rotateBase64Img = (src, edg, callback) => {
try {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
let imgW = 0 // 图片宽度
let imgH = 0 // 图片高度
let size = 0 // canvas初始大小
if (edg % 90 !== 0) {
throw new Error('旋转角度必须是90的倍数!')
}
(edg < 0) && (edg = (edg % 360) + 360)
const quadrant = (edg / 90) % 4 // 旋转象限
const cutCoor = { sx: 0, sy: 0, ex: 0, ey: 0 } // 裁剪坐标
const image = new Image()
image.src = src
image.crossOrigin = 'anonymous'
image.onload = function () {
imgW = image.width
imgH = image.height
size = imgW > imgH ? imgW : imgH
canvas.width = size * 2
canvas.height = size * 2
switch (quadrant) {
case 0:
cutCoor.sx = size
cutCoor.sy = size
cutCoor.ex = size + imgW
cutCoor.ey = size + imgH
break
case 1:
cutCoor.sx = size - imgH
cutCoor.sy = size
cutCoor.ex = size
cutCoor.ey = size + imgW
break
case 2:
cutCoor.sx = size - imgW
cutCoor.sy = size - imgH
cutCoor.ex = size
cutCoor.ey = size
break
case 3:
cutCoor.sx = size
cutCoor.sy = size - imgW
cutCoor.ex = size + imgH
cutCoor.ey = size + imgW
break
}
ctx.translate(size, size)
ctx.rotate(edg * Math.PI / 180)
ctx.drawImage(image, 0, 0)
const imgData = ctx.getImageData(cutCoor.sx, cutCoor.sy, cutCoor.ex, cutCoor.ey)
if (quadrant % 2 === 0) {
canvas.width = imgW
canvas.height = imgH
} else {
canvas.width = imgH
canvas.height = imgW
}
ctx.putImageData(imgData, 0, 0)
if (typeof callback === 'function') {
const blob = base64ImgtoFile(canvas.toDataURL('image/png', 0.7))
const blobUrl = window.URL.createObjectURL(blob);
callback(blobUrl)
}
}
} catch (e) {
console.log(e)
}
}
function base64ImgtoFile (dataurl, filename = 'file') {
//将base64格式分割['data:image/png;base64','XXXX']
const arr = dataurl.split(',')
// .* 表示匹配任意字符到下一个符合条件的字符 刚好匹配到:
// image/png
const mime = arr[0].match(/:(.*?);/)[1] //image/png
//[image,png] 获取图片类型后缀
const suffix = mime.split('/')[1] //png
const bstr = atob(arr[1]) //atob() 方法用于解码使用 base-64 编码的字符串
let n = bstr.length
const u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new File([u8arr], `${filename}.${suffix}`, {
type: mime
})
}
Loading…
Cancel
Save