This commit is contained in:
qiaojiale 2025-06-06 15:07:26 +08:00
parent c711239127
commit 2b53798b0d
891 changed files with 89818 additions and 81836 deletions

45
api/partner.js Normal file
View File

@ -0,0 +1,45 @@
const login = '/users/admin-login' //登录
const loginInfo = '/users/get-info' //登录信息
const getPartner = '/dealer/get-one' //经销商信息
const getPackageList = '/new-install/packages' //套餐购买列表
const getMasterList = '/master/list' //师傅列表
const createNewOrder = '/new-install/create' //创建新装工单
const phoneSearch = '/customer/phone-search' //搜索客户电话
const getproductList = '/water/dealer/deposit_pack_product'//新增工单产品
const deviceList = '/device/list' //设备列表
const createRepairOrder = '/order-repair/create'//创建维修订单
const getUninstallList = '/uninstall/list' //拆除工单
const getUninstallInfo = '/uninstall/one' //拆除工单详情
const getPartList = '/part_replace/list' //更换工单列表
const getPartInfo = '/part_replace/one' //更换工单详情
const masterSelect = '/master/select' //更换工单详情
const assignPartReplaceMaster = '/part_replace/assign' //指派
const apiArr = {
masterSelect,
getproductList,
assignPartReplaceMaster,
login,
getPartList,
getPartInfo,
getUninstallList,
getUninstallInfo,
createRepairOrder,
deviceList,
loginInfo,
getPartner,
getPackageList,
getMasterList,
createNewOrder,
phoneSearch
}
module.exports = apiArr;

View File

@ -1,9 +1,16 @@
const pay = '/lakala/preorder' //预下单 const pay = '/lakala/preorder' //预下单
const queryPay = '/lakala/trade-query' //查询交易结果 const queryPay = '/lakala/trade-query' //查询交易结果
const queryPayByWechat = '/wechat/water/query_pay' //查询交易结果
const HsqueryPay = '/lakala/hs-preorder' //预下单
const HsqueryPayByWechat = '/lakala/hs-trade-query' //查询交易结果
const PayJs = { const PayJs = {
pay, pay,
queryPay queryPay,
HsqueryPay,
HsqueryPayByWechat,
queryPayByWechat
} }
module.exports = PayJs; module.exports = PayJs;

View File

@ -1,7 +1,9 @@
const repair = '/wechat/water/device/one-key-repair' //一键报修 const repair = '/wechat/water/device/one-key-repair' //一键报修
const getUserList = '/wechat/water/device/list' //获取用户设备列表 const getUserList = '/wechat/water/device/list' //获取用户设备列表
const changeDef = '/wechat/water/device/first' //切换默认设备 const changeDef = '/wechat/water/device/first' //切换默认设备
const getpackageList = '/wechat/water/device/package-list' //获取套餐列表 // const getpackageList = '/wechat/water/device/package-list' //获取套餐列表
const getpackageList = '/wechat/water/device-package' //获取套餐列表
const createPackageOrder = '/wechat/water/device/package-buy'//创建套餐订单 const createPackageOrder = '/wechat/water/device/package-buy'//创建套餐订单
const getCurrentShopMsg = '/wechat/water/device/shop-info' //获取当前商户信息 const getCurrentShopMsg = '/wechat/water/device/shop-info' //获取当前商户信息
const getdeviceListByid = '/wechat/water/device/parts-list' //根据id获取可购买设备 const getdeviceListByid = '/wechat/water/device/parts-list' //根据id获取可购买设备
@ -12,6 +14,11 @@ const changeOrderState = '/wechat/water/device/pay-parts-buy' //变更滤芯订
const getOrderPayList = '/wechat/water/device/parts-buy-list' //滤芯购买记录 const getOrderPayList = '/wechat/water/device/parts-buy-list' //滤芯购买记录
const getFilterChangeList = '/wechat/water/dealer/part-replace-list' //滤芯购买记录
const resetFilter = '/waters/reset-filter' //重置滤芯
// const getUserBanlance = '/wechat/water/device/balance' //我的余额 // const getUserBanlance = '/wechat/water/device/balance' //我的余额
const getTotalBanlance = '/wechat/water/dealer/statistics-money' //我的收益 const getTotalBanlance = '/wechat/water/dealer/statistics-money' //我的收益
const getOrderBuyList = '/wechat/water/device/package-buy-list' //查询套餐订单列表 const getOrderBuyList = '/wechat/water/device/package-buy-list' //查询套餐订单列表
@ -21,7 +28,8 @@ const getFilterListByid = '/wechat/water/device/device-parts' //根据设备id
const MasterList = '/wechat/water/dealer/master-list' //师傅列表 // const MasterList = '/wechat/water/dealer/master-list' //师傅列表
const MasterList = '/master/list' //师傅列表
const masterDesc = '/wechat/water/dealer/one-master' //师傅详情 const masterDesc = '/wechat/water/dealer/one-master' //师傅详情
const createMaster = '/wechat/water/dealer/create-master' //创建傅信息 const createMaster = '/wechat/water/dealer/create-master' //创建傅信息
const editMaster = '/wechat/water/dealer/set-master' //创建傅信息 const editMaster = '/wechat/water/dealer/set-master' //创建傅信息
@ -31,26 +39,32 @@ const getPhoneByUser = '/wechat/water/dealer/phone-master' //创建师傅的时
const OrderList = '/wechat/water/dealer/repair-order-list' //维修工单列表 const OrderList = '/wechat/water/dealer/repair-order-list' //维修工单列表
const addOrderItem = '/wechat/water/dealer/repair-order-create' //新增维修工单 const addOrderItem = '/wechat/water/dealer/repair-order-create' //新增维修工单
const repairOrderOne = '/wechat/water/dealer/repair-order-one' // 维修工单详情 const repairOrderOne = '/wechat/water/dealer/repair-order-one' // 维修工单详情
const orderRepairAssign = '/wechat/water/dealer/order-repair-assign' // 维修工单分配师傅 const orderRepairAssign = '/wechat/water/dealer/order-repair-assign' // 维修工单分配师傅
const RecallRepair = '/wechat/water/dealer/complete-repair' // 撤回维修工单 const RecallRepair = '/wechat/water/dealer/complete-repair' // 撤回维修工单
const RecallNewRepair = '/wechat/water/dealer/complete-new-install' // 撤回新装工单 // const RecallNewRepair = '/wechat/water/dealer/complete-new-install' // 撤回新装工单
const RecallNewRepair = '/water/new-install-cancel' // 撤回新装工单
const deviceDesc = '/device/one' //设备详情 const deviceDesc = '/device/one' //设备详情
const newOrderList = '/wechat/water/dealer/get_list_new_install' //新装工单列表 // const newOrderList = '/wechat/water/dealer/get_list_new_install' //新装工单列表
const userNewOrderList = '/wechat/water/get_list_new_install' //微信新装工单列表 const newOrderList = '/new-install/list' //新装工单列表
const userNewOrderList = '/wechat/water/new-install-list' //微信新装工单列表
const newOrderDesc = '/wechat/water/dealer/new-install-one' //新装工单详情 const newOrderDesc = '/wechat/water/new-install-info' //新装工单详情
const creNewOrder = '/new-install/create' //创建新装工单 const creNewOrder = '/new-install/create' //创建新装工单
const newInstallAssign = '/wechat/water/dealer/new-install-assign' // 新装工单分配师傅 // const newInstallAssign = '/wechat/water/dealer/new-install-assign' // 新装工单分配师傅
const newInstallAssign = '/new-install/assign' // 新装工单分配师傅
const packageList = '/package-buy/list' //套餐列表 const packageList = '/package-buy/list' //套餐列表
const packageDesc = '/package-buy/list' //套餐详情 const packageDesc = '/package-buy/list' //套餐详情
const BXList = '/wechat/water/device/repair-list' //报修列表 const BXList = '/wechat/water/device/repair-list' //报修列表
const BXOneRepair = '/wechat/water/device/one-repair' // 获取维修工单详情 const BXOneRepair = '/wechat/water/device/one-repair' // 获取维修工单详情
const BXDeviceList = '/wechat/water/device/list' // 获取用户设备列表 const BXDeviceList = '/wechat/water/device/list' // 获取用户设备列表
const login = '/wechat/mpusers/login' // 小程序登录 const login = '/wechat/mpusers/login' // 小程序登录
@ -76,6 +90,7 @@ const createQrcode = '/wechat/water/device/qr-code' //获取小程序码
const getVersion = '/wechat/audit/app_versions' //获取版本信息 const getVersion = '/wechat/audit/app_versions' //获取版本信息
const accountLogin = '/wechat/audit/app_login' //审核登录 const accountLogin = '/wechat/audit/app_login' //审核登录
const updateVersion = '/api/v1/audit/config-update'
@ -88,7 +103,15 @@ const NewOrderDesc = '/wechat/water/master/new-install-one' //师傅新装工单
const RepairOrderDesc = '/wechat/water/master/repair-order-one' //师傅更换工单详情 const RepairOrderDesc = '/wechat/water/master/repair-order-one' //师傅更换工单详情
const PartOrderDesc = '/wechat/water/master/part-replace-one' // 师傅耗材更换详情 const PartOrderDesc = '/wechat/water/master/part-replace-one' // 师傅耗材更换详情
const getUninstallOrder = '/wechat/water/master/uninstall/list' //拆卸工单
const getUninstallDesc = '/wechat/water/master/uninstall/info' //拆除工单详情
const unintsall = '/wechat/water/master/uninstall/complete' //拆机
const operate = '/wechat/water/master/uninstall/operate' //入库 报废
const completeNewOrder = '/wechat/water/dealer/complete-new-install' //完成新装工单 const completeNewOrder = '/wechat/water/dealer/complete-new-install' //完成新装工单
const cancelNewOrder = '/wechat/water/new-install-cancel' //取消新装工单
const completeRepairOrder = '/wechat/water/master/complete-repair' //完成维修工单 const completeRepairOrder = '/wechat/water/master/complete-repair' //完成维修工单
const completePartOrder = '/wechat/water/master/complete-part-replace' //完成耗材更换工单 const completePartOrder = '/wechat/water/master/complete-part-replace' //完成耗材更换工单
@ -97,18 +120,45 @@ const getDeviceByCode = '/wechat/water/dealer/device-code' //根据编码获取
const masterInfo = '/wechat/water/master/master-info' //师傅信息 const masterInfo = '/wechat/water/master/master-info' //师傅信息
const editMasterInfo = '/wechat/water/master/set-master-info' //修改师傅信息 const editMasterInfo = '/wechat/water/master/set-master-info' //修改师傅信息
const masterDeviceList = '/wechat/water/master/device/list' //师傅安装的设备列表
const masterDeviceInfo = '/wechat/water/master/device/info' //设备详情
const createUninstallOrder = '/wechat/water/master/uninstall/create' //创建拆除工单
const getDeposit = '/wechat/water/deposit_pay' //获取押金信息 const getDeposit = '/wechat/water/deposit_pay' //获取押金信息
const getDepositList = '/wechat/water/deposit_list' //获取押金信息
const city = '/citys/s/list' // 获取省份列表' const city = '/citys/s/list' // 获取省份列表'
const area = '/citys/c/list' // 获取市列表' const area = '/citys/c/list' // 获取市列表'
const business = '/citys/x/list' // 获取区列表' const business = '/citys/x/list' // 获取区列表'
const createPosit = '/wechat/water/create_posit_info' //创建押金缴纳 const createPosit = '/wechat/water/create_posit_info' //创建押金缴纳
const openOff = '/waters/board-on-off' //开机关机
const boardInfo = '/waters/board-info-query' //主板信息
const cancelActivation = '/waters/cancel-activation' //主板取消
const scanOrder = '/wechat/trans-order/confirm' //查询是否有转账
const queryOrder = '/wechat/trans-order/success' //确认是否转账
const BeActive = '/wechat/water/dealer/active-device' //激活设备
const apiArr = { const apiArr = {
cancelActivation,
queryOrder,
createUninstallOrder,
scanOrder,
BeActive,
boardInfo,
createPosit, createPosit,
openOff,
getUninstallOrder,
getUninstallDesc,
unintsall,
city, city,
area, area,
business, business,
getDeposit, getDeposit,
getDepositList,
MasterList, MasterList,
masterDesc, masterDesc,
editMaster, editMaster,
@ -145,6 +195,8 @@ const apiArr = {
createDeviceOrder, createDeviceOrder,
changeOrderState, changeOrderState,
getOrderPayList, getOrderPayList,
getFilterChangeList,
resetFilter,
// getUserBanlance, // getUserBanlance,
getTotalBanlance, getTotalBanlance,
getOrderBuyList, getOrderBuyList,
@ -161,6 +213,7 @@ const apiArr = {
createQrcode, createQrcode,
getVersion, getVersion,
accountLogin, accountLogin,
updateVersion,
getNewOrder, getNewOrder,
gerRepairOrder, gerRepairOrder,
getPartOrder, getPartOrder,
@ -168,10 +221,14 @@ const apiArr = {
RepairOrderDesc, RepairOrderDesc,
PartOrderDesc, PartOrderDesc,
completeNewOrder, completeNewOrder,
cancelNewOrder,
completeRepairOrder, completeRepairOrder,
completePartOrder, completePartOrder,
operate,
masterInfo, masterInfo,
editMasterInfo, editMasterInfo,
masterDeviceList,
masterDeviceInfo,
getDeviceByCode getDeviceByCode
} }
module.exports = apiArr; module.exports = apiArr;

View File

@ -1,16 +1,23 @@
{ {
"pages": [ "pages": [
"pages/chooseEntrance/chooseEntrance",
"pages/water_filter/water_filter", "pages/water_filter/water_filter",
"pages/index/newIndex/newIndex", "pages/info/info",
"pages/index/shopcity", "pages/Agreement/Agreement",
"pages/share/share",
"pages/community/detail", "pages/community/detail",
"pages/map/map", "pages/map/map",
"pages/login/login", "pages/login/login",
"pages/MasterLogin/MasterLogin",
"pages/phoneGo/phoneGo", "pages/phoneGo/phoneGo",
"pages/chooseCommunity/chooseCommunity", "pages/chooseCommunity/chooseCommunity",
"pages/device/device", "pages/device/device",
"pages/deposit/deposit", "pages/deposit/deposit",
"pages/newOrderList/newOrderList" "pages/newOrderList/newOrderList",
"pages/newOrderListDesc/index",
"pages/RechargeRecord/RechargeRecord",
"pages/filterChange/filterChange",
"pages/SubscribeMessage/SubscribeMessage"
], ],
"subPackages": [ "subPackages": [
{ {
@ -37,7 +44,8 @@
"pages/shareWaterFilter/shareWaterFilter", "pages/shareWaterFilter/shareWaterFilter",
"pages/test/test", "pages/test/test",
"pages/Addfriend/Addfriend", "pages/Addfriend/Addfriend",
"pages/water_change/water_change" "pages/water_change/water_change",
"pages/filterChangeList/filterChangeList"
] ]
}, },
{ {
@ -66,16 +74,24 @@
"pages":[ "pages":[
"order/index", "order/index",
"orderDesc/index", "orderDesc/index",
"PersonCen/index" "PersonCen/index",
"masterInfo/index",
"device/index",
"deviceInfo/index"
] ]
}, },
{ {
"root": "packages/partner", "root": "packages/partner",
"pages": [ "pages": [
"pages/login/login",
"pages/partner", "pages/partner",
"pages/purchaseGoods/purchaseGoods", "pages/purchaseGoods/purchaseGoods",
"pages/WorkOrder/WorkOrder", "pages/WorkOrder/WorkOrder",
"pages/newWorkOrder/newWorkOrder", "pages/newWorkOrder/newWorkOrder",
"pages/removeOrder/removeOrder",
"pages/removeOrderInfo/removeOrderInfo",
"pages/partsOrder/partsOrder",
"pages/partsOrderInfo/partsOrderInfo",
"pages/orderDesc/orderDesc", "pages/orderDesc/orderDesc",
"pages/team/team", "pages/team/team",
"pages/invite/invite", "pages/invite/invite",
@ -86,19 +102,17 @@
"pages/desk/desk", "pages/desk/desk",
"pages/income/income", "pages/income/income",
"pages/incomeDesc/incomeDesc", "pages/incomeDesc/incomeDesc",
"pages/incomeDetail/incomeDetail" "pages/incomeDetail/incomeDetail",
"pages/addNewOrder/addNewOrder"
] ]
} }
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation",
"chooseAddress",
"chooseLocation"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff", "navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "衡水喜屏智慧社区", "navigationBarTitleText": "人人爱净水",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",

View File

@ -7,7 +7,12 @@ page{
font-size: 28rpx; font-size: 28rpx;
padding-bottom: 120rpx; padding-bottom: 120rpx;
} }
.van-dropdown-menu__title--active {
color: #2583ff !important;
}
.van-dropdown-item__option--active .van-dropdown-item__icon, .van-dropdown-item__option--active .van-dropdown-item__title {
color: #2583ff !important;
}
image{ image{
display: block; display: block;
} }

View File

@ -0,0 +1,93 @@
import apiAddr from '../../api/base';
import { setData } from '../../utils/index';
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
nav_list:[],
foot_width:'20%',
},
/**
* 组件的方法列表
*/
methods: {
getFootnav(){
let _that = this;
wx.request({
url: apiAddr.footer_nav_list,
method: 'post',
header: { 'Content-type': 'application/x-www-form-urlencoded' },
data: {},
dataType: 'json',
success: (result) => {
result.data[0].url = "/pages/index/newIndex/newIndex"
result.data[1].url = "/pages/device/device"
result.data[2].nav_name = "手机通行"
result.data[2].url = "/pages/phoneGo/phoneGo"
// result.data[3].url = `/packages/community/communityList/index?communityId=${communityIdArr}`
result.data[3].url = `/packages/community/communityList/index`
result.data[4].url = "/pages/index/index"
result.data.splice(1, 2);
setData(_that,'nav_list', result.data);
setData(_that,'foot_width', (100/result.data.length).toFixed(2)+'%');
},
});
},
//暂未开通
NotOpen(){
wx.showModal({
title: '提示',
content: '此功能暂未开通!',
showCancel:false,
complete: (res) => {
if (res.cancel) {
}
}
})
},
jump(e){
const ctoken = wx.getStorageSync('ctoken');
const authen = ['/pages/index/newIndex/newIndex', '/pages/index/index'];
// 除首页及个人中心页不需要鉴定ctoken 其他tab页均需存在登录态才可访问
if (authen.includes(e.currentTarget.dataset.url)) {
wx.redirectTo({
url: e.currentTarget.dataset.url,
})
return
}
if (!ctoken) {
wx.redirectTo({
url: '/pages/login/login',
})
return;
}
wx.redirectTo({
url: e.currentTarget.dataset.url,
})
},
},
lifetimes: {
attached: function () {
// 组件被添加到页面节点树时执行
this.getFootnav();
},
},
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,9 @@
<view class="foot-fixed">
<block wx:for="{{nav_list}}" wx:key="unique">
<!-- <view>{{item.photo}}</view> -->
<view id="navIndex" bind:tap="jump" data-idx="{{index}}" data-url="{{item.url}}" style="width:{{foot_width}}" class="foot-item">
<view class="foot-icon" style="background: url({{item.photo}}) center center no-repeat; background-size: contain;"></view>
<text class="foot-label" id="navIndexLabel">{{item.nav_name}}</text>
</view>
</block>
</view>

View File

@ -0,0 +1,3 @@
/* pages/public/footer.wxss */
@import "../../app.wxss";

View File

@ -16,7 +16,7 @@
} }
.state { .state {
width: 100rpx; width: 100rpx;
color: #FF512A; color: #2583FF;
font-weight: bold; font-weight: bold;
} }
.main { .main {
@ -47,13 +47,13 @@
} }
.article_symbol { .article_symbol {
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
font-weight: 400; font-weight: 400;
} }
.article_desc { .article_desc {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
} }
.bottom { .bottom {
margin-top: 12rpx; margin-top: 12rpx;
@ -87,7 +87,7 @@
} }
.btn_right { .btn_right {
padding: 10rpx 11rpx; padding: 10rpx 11rpx;
background: #FF512A; background: #2583FF;
} }
.shop_detail { .shop_detail {

View File

@ -0,0 +1,50 @@
import apiAddr from '../../api/base';
import { setData } from '../../utils/index';
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
nav_list:[
{
url:"/pages/water_filter/water_filter",
nav_name:"设备",
photo:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/deviceIcon.png"
},
{
url:"/pages/info/info",
nav_name:"我的",
photo:"https://zhsq.hshuishang.com/attachs/navigation/2024/12/23/6768c0b16ce89.png"
},
],
foot_width:'50%',
},
/**
* 组件的方法列表
*/
methods: {
jump(e){
console.log(e);
wx.redirectTo({
url: e.currentTarget.dataset.url,
})
},
},
lifetimes: {
attached: function () {
// 组件被添加到页面节点树时执行
},
},
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,9 @@
<view class="foot-fixed">
<block wx:for="{{nav_list}}" wx:key="unique">
<!-- <view>{{item.photo}}</view> -->
<view id="navIndex" bind:tap="jump" data-idx="{{index}}" data-url="{{item.url}}" style="width:{{foot_width}}" class="foot-item">
<view class="foot-icon" style="background: url({{item.photo}}) center center no-repeat; background-size: contain;"></view>
<text class="foot-label" id="navIndexLabel">{{item.nav_name}}</text>
</view>
</block>
</view>

View File

@ -0,0 +1,3 @@
/* pages/public/footer.wxss */
@import "../../app.wxss";

View File

@ -32,10 +32,6 @@ Component({
dataType: 'json', dataType: 'json',
success: (result) => { success: (result) => {
// let communityId = wx.getStorageSync('communityId')
// let communityIdArr = ''
// communityIdArr = communityId.join(',')
// console.log(communityIdArr,'communityIdcommunityId');
result.data[0].url = "/pages/index/newIndex/newIndex" result.data[0].url = "/pages/index/newIndex/newIndex"
result.data[1].url = "/pages/device/device" result.data[1].url = "/pages/device/device"

View File

@ -0,0 +1,50 @@
import apiAddr from '../../api/base';
import { setData } from '../../utils/index';
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
nav_list:[
{
url:"/packages/master/order/index",
nav_name:"订单",
photo:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon3.png?1"
},
{
url:"/packages/master/PersonCen/index",
nav_name:"我的",
photo:"https://zhsq.hshuishang.com/attachs/navigation/2024/12/23/6768c0b16ce89.png"
},
],
foot_width:'50%',
},
/**
* 组件的方法列表
*/
methods: {
jump(e){
wx.redirectTo({
url: e.currentTarget.dataset.url,
})
},
},
lifetimes: {
attached: function () {
// 组件被添加到页面节点树时执行
},
},
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,9 @@
<view class="foot-fixed">
<block wx:for="{{nav_list}}" wx:key="unique">
<!-- <view>{{item.photo}}</view> -->
<view id="navIndex" bind:tap="jump" data-idx="{{index}}" data-url="{{item.url}}" style="width:{{foot_width}}" class="foot-item">
<view class="foot-icon" style="background: url({{item.photo}}) center center no-repeat; background-size: contain;"></view>
<text class="foot-label" id="navIndexLabel">{{item.nav_name}}</text>
</view>
</block>
</view>

View File

@ -0,0 +1,3 @@
/* pages/public/footer.wxss */
@import "../../app.wxss";

View File

@ -2,7 +2,7 @@
<view class="locat" catchtap="goPagesLink"> <view class="locat" catchtap="goPagesLink">
<image class="local_left_icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/User/_assets/location.png" mode=""/> <image class="local_left_icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/User/_assets/location.png" mode=""/>
<text class="local_city">{{address}}</text> <text class="local_city">{{address}}</text>
<van-icon name="arrow-down" color="#FF512A " /> <van-icon name="arrow-down" color="#2583FF " />
</view> </view>
<view class='search_bar'> <view class='search_bar'>
<image class="search_icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/_assets/Group_36.png" mode=""/> <image class="search_icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/_assets/Group_36.png" mode=""/>

BIN
miniprogram_npm.zip Normal file

Binary file not shown.

View File

@ -48,7 +48,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -97,6 +100,17 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage(){ onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -13,7 +13,7 @@ image {
.btn { .btn {
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC; font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400; font-weight: 400;

View File

@ -179,10 +179,11 @@ Page({
region:that.data.area, region:that.data.area,
address:that.data.address, address:that.data.address,
parts_ids, parts_ids,
total_price:that.data.price, total_price:String(that.data.price),
customer_name:that.data.name, customer_name:that.data.name,
customer_phone:that.data.phone, customer_phone:that.data.phone,
user_id:Number(wx.getStorageSync('userId')) user_id:Number(wx.getStorageSync('userId')),
is_up_door:1
},res=>{ },res=>{
that.setData({ that.setData({
orderMsg:res orderMsg:res
@ -222,7 +223,7 @@ pay(){
remark:that.data.message, remark:that.data.message,
subject, subject,
term_no:that.data.GoodsMsg.term_no, term_no:that.data.GoodsMsg.term_no,
total_amount:String(1), total_amount:String(that.data.price * 100),
user:String(wx.getStorageSync('userId')), user:String(wx.getStorageSync('userId')),
user_id:wx.getStorageSync('openId') user_id:wx.getStorageSync('openId')
},res=>{ },res=>{
@ -254,6 +255,9 @@ queryPay(){
out_trade_no:that.data.orderMsg.OrderNo out_trade_no:that.data.orderMsg.OrderNo
},res=>{ },res=>{
if(res.statusCode == '200'){ if(res.statusCode == '200'){
// wx.requestSubscribeMessage({
// tmplIds:["5yPg-WOoP9-9ZU1fHjC4zg1KNaPWb76K87JzzKb58f0"]
// })
wx.showToast({ wx.showToast({
title: '支付成功!', title: '支付成功!',
}) })
@ -311,13 +315,30 @@ queryPay(){
show:false show:false
}) })
}, },
onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
}
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let that= this let that= this
that.getPartsByid() that.getPartsByid()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**

View File

@ -1,7 +1,7 @@
<view class="box"> <view class="box">
<view class="filterList"> <view class="filterList">
<view class="filterItem" wx:for="{{PartsList}}"> <view class="filterItem" wx:for="{{PartsList}}">
<van-checkbox value="{{ item.checked }}" data-idx="{{index}}" data-price="{{item.unit_price}}" data-id="{{item.parts_id}}" shape="square" bind:change="onChange" checked-color="#ff512a"> <van-checkbox value="{{ item.checked }}" data-idx="{{index}}" data-price="{{item.unit_price}}" data-id="{{item.parts_id}}" shape="square" bind:change="onChange" checked-color="#2583FF">
</van-checkbox> </van-checkbox>
<view class="filterItem_Msg"> <view class="filterItem_Msg">
<view class="filterItem_Img"> <view class="filterItem_Img">

View File

@ -107,11 +107,11 @@
.filterItem_Con_tagList .tag { .filterItem_Con_tagList .tag {
font-weight: 400; font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
height: 32rpx; height: 32rpx;
background: #FFE8E8; background: #FFE8E8;
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
border: 1rpx solid #FF512A; border: 1rpx solid #2583FF;
padding: 0 10rpx; padding: 0 10rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
@ -119,7 +119,7 @@
.filterItem_Con_msg { .filterItem_Con_msg {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
} }
.gray { .gray {
@ -189,7 +189,7 @@
.foot_mony { .foot_mony {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -197,7 +197,7 @@
.foot_mony text { .foot_mony text {
font-weight: 400; font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
} }
.foot_btn { .foot_btn {
@ -206,7 +206,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 180rpx; width: 180rpx;
height: 62rpx; height: 62rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -71,11 +71,21 @@ Page({
user_id: Number(wx.getStorageSync('userId')) user_id: Number(wx.getStorageSync('userId'))
} }
} }
wx.showLoading({
title: '加载中...',
mask: true
})
postUrl(apiArr.BXList, params, res => { postUrl(apiArr.BXList, params, res => {
wx.hideLoading()
if (res.rows) {
res.rows.forEach(item => { res.rows.forEach(item => {
item.product_icon = util.img_url + item.product_icon item.product_icon = util.img_url + item.product_icon
item.create_time = item.create_time.slice(0, 16) item.create_time = item.create_time.slice(0, 16)
if (item.fault_imgs) {
item.fault_imgs = util.img_url + item.fault_imgs
}
}) })
}
if (that.data.page_num == 1) { if (that.data.page_num == 1) {
that.setData({ that.setData({
BxList: [] BxList: []
@ -98,6 +108,10 @@ Page({
onLoad(options) { onLoad(options) {
// let that = this // let that = this
// that.getBxList() // that.getBxList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -117,7 +131,6 @@ Page({
flag: false, flag: false,
BxList: [] BxList: []
}) })
console.log(that.data.page_num,that.data.BxList);
setTimeout(() => { setTimeout(() => {
that.getBxList(that.data.statusType) that.getBxList(that.data.statusType)
}, 10) }, 10)
@ -155,6 +168,17 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -22,12 +22,12 @@
<view class="recordList"> <view class="recordList">
<view class="recordItem" wx:if="{{BxList.length != 0}}" wx:for="{{BxList}}" data-id="{{item.repair_id}}" wx:key="index" bindtap="handleInfoClick"> <view class="recordItem" wx:if="{{BxList.length != 0}}" wx:for="{{BxList}}" data-id="{{item.repair_id}}" wx:key="index" bindtap="handleInfoClick">
<view class="recordItem_img"> <view class="recordItem_img" wx:if="{{item.fault_imgs}}">
<image src="{{item.product_icon}}" mode="widthFix" /> <image src="{{item.fault_imgs}}" mode="widthFix" />
</view> </view>
<view class="recordItem_Msg"> <view class="recordItem_Msg">
<view class="recordItem_Msg_left"> <view class="recordItem_Msg_left">
<view class="recordItem_Msg_left_tit">{{item.product_name}}</view> <view class="recordItem_Msg_left_tit">{{item.device_code}}</view>
<view class="recordItem_Msg_left_msg"> <view class="recordItem_Msg_left_msg">
提交时间:{{item.create_time}} 提交时间:{{item.create_time}}
</view> </view>

View File

@ -70,7 +70,7 @@
content: ''; content: '';
width: 64rpx; width: 64rpx;
height: 10rpx; height: 10rpx;
background: #FF512A; background: #2583FF;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
@ -82,7 +82,7 @@
content: ''; content: '';
width: 54rpx; width: 54rpx;
height: 4rpx; height: 4rpx;
background: #FF5D73; background: #2583FF;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
filter: blur(12rpx); filter: blur(12rpx);
position: absolute; position: absolute;
@ -141,7 +141,7 @@
.recordItem_Msg_right_state2 { .recordItem_Msg_right_state2 {
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -191,7 +191,7 @@
.btn { .btn {
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400; font-weight: 400;
font-size: 36rpx; font-size: 36rpx;

View File

@ -1,113 +1,39 @@
<view class="box"> <view class="box">
<!-- <view class="nav-box" style="padding-top: {{ t }}px;;">
<view class="nav-bar" style="height: {{ h }}px;">
<view class="nav-bar-left" bindtap="handleNavigateBack">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/back_black.png" mode="widthFix" style="width:16rpx;height:28rpx" />
</view>
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;">
报修详情
</view>
<view class="nav-bar-right"></view>
</view>
</view> -->
<!-- <view class="tabList">
<view class="{{tabIndex == 0?'active':''}} tabItem" data-index="0" bindtap="changeTabItem">报修进度</view>
<view class="{{tabIndex == 1?'active':''}} tabItem" data-index="1" bindtap="changeTabItem">报修详情</view>
</view> -->
<!-- 维修进度 -->
<!-- <view class="maintenance_progress" wx:if="{{tabIndex == 0}}" style="min-height: calc( 100vh - 145rpx - {{h}}px - {{t}}px);">
<view class="progress">
<view class="progress_step">
<view class="progress_step_time">
<view class="progress_step_cir">
<view class="progress_step_cir2"></view>
</view>
今天 16:00
</view>
<view class="progress_step_msg">
订单完成
</view>
</view>
<view class="progress_step">
<view class="progress_step_time">
<view class="progress_step_cir">
<view class="progress_step_cir2"></view>
</view>
2021.10.11 11:15
</view>
<view class="progress_step_msg2">
维修师傅已经到达现场,努力维修中...
</view>
</view>
<view class="progress_step">
<view class="progress_step_time">
<view class="progress_step_cir">
<view class="progress_step_cir2"></view>
</view>
{{repairInfo.repair_time}}
</view>
<view class="progress_step_msg2">
厂家已为您指派维修师傅{{repairInfo.repairman_name}}
<view class="progress_step_person">
<view class="progress_step_person_left">
<view class="personAva">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_person.png" mode="widthFix" />
</view>
<view class="personInfo">
<view class="personInfo_name">
<text>{{repairInfo.repairman_name}}</text>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_star.png" mode="widthFix" />
</view>
<view class="personInfo_phone">{{repairInfo.repairman_phone}}</view>
</view>
</view>
<view class="personCall" bindtap="headerTelClick">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_phone.png" mode="widthFix" />
</view>
</view>
</view>
</view>
<view class="progress_step">
<view class="progress_step_time">
<view class="progress_step_cir">
<view class="progress_step_cir2"></view>
</view>
{{repairInfo.create_time}}
</view>
<view class="progress_step_msg2">
您的维修订单已提交,即将安排维修师傅。
</view>
</view>
</view>
</view> -->
<!-- 维修详情 --> <!-- 维修详情 -->
<view class="InfoList"> <view class="InfoList">
<view class="InfoMsg"> <view class="InfoMsg">
<view class="InfoMsg_tit">设备信息</view> <view class="InfoMsg_tit">设备信息</view>
<view class="InfoMsg_info">设备编码: <text>{{repairInfo.device_code}}</text> </view> <view class="InfoMsg_info">设备编码: <text>{{repairInfo.device_code}}</text> </view>
<view class="InfoMsg_info">设备名称: <text>{{repairInfo.product_name}}</text> </view>
</view> </view>
<view class="InfoItem"> <view class="InfoItem">
<view class="InfoItem_tit">故障信息</view> <view class="InfoItem_tit">故障信息</view>
<view class="InfoItem_msg"><text>报修单号</text>{{repairInfo.repair_no}}</view> <view class="InfoItem_msg"><text>报修单号</text>{{repairInfo.repair_no}}</view>
<view class="InfoItem_msg"><text>故障描述</text>{{repairInfo.fault_desc}}</view> <view class="InfoItem_msg"><text>故障描述</text>{{repairInfo.fault_desc}}</view>
<view class="InfoItem_msg"><text>维修人</text> {{repairInfo.repairman_name}}</view> <view class="InfoItem_msg"><text>报修人</text> {{repairInfo.customer_name}}</view>
<view class="InfoItem_msg dispay"> <view class="InfoItem_msg dispay">
<view class="InfoItem_msg no_bottom"> <view class="InfoItem_msg no_bottom">
<text>维修地址</text> <text>报修人电话</text>
<view class="label">{{repairInfo.region}}{{repairInfo.address}}</view> <view class="label">{{repairInfo.repairman_phone}}</view>
</view> </view>
<view class="personCall" wx:if="{{item.repairman_phone}}" bindtap="headerTelClick"> <view class="personCall" wx:if="{{item.repairman_phone}}" bindtap="headerTelClick">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_phone.png" mode="widthFix" /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_phone.png" mode="widthFix" />
</view> </view>
</view> </view>
<view class="InfoItem_msg dispay">
<view class="InfoItem_msg no_bottom">
<text>报修地址</text>
<view class="label">{{repairInfo.region}}{{repairInfo.address}}</view>
</view>
</view>
<!-- <view class="InfoItem_msg"><text>故障时间</text>2022-05-11 09:26</view> --> <!-- <view class="InfoItem_msg"><text>故障时间</text>2022-05-11 09:26</view> -->
<view class="InfoItem_msg"><text>报修时间</text>{{repairInfo.create_time}}</view> <view class="InfoItem_msg"><text>报修时间</text>{{repairInfo.create_time}}</view>
</view> </view>
</view> </view>

View File

@ -1,6 +1,6 @@
.box { .box {
background-color: #F9F9F9; background-color: #F9F9F9;
min-height: 100vh; min-height: 90vh;
} }
.nav-box { .nav-box {
@ -64,7 +64,7 @@
content: ''; content: '';
width: 130rpx; width: 130rpx;
height: 10rpx; height: 10rpx;
background: #FF512A; background: #2583FF;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
@ -187,7 +187,7 @@
.progress_step_cir2 { .progress_step_cir2 {
width: 18rpx; width: 18rpx;
height: 18rpx; height: 18rpx;
background: #FF512A; background: #2583FF;
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
} }
@ -205,7 +205,7 @@
.progress_step_msg { .progress_step_msg {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #FF512A; color: #2583FF;
border-left: 2rpx dashed #C4C4C4; border-left: 2rpx dashed #C4C4C4;
padding-left: 44rpx; padding-left: 44rpx;
box-sizing: border-box; box-sizing: border-box;

View File

@ -29,6 +29,7 @@ Page({
}, },
orderMsg: "", orderMsg: "",
goodsMsg: "", goodsMsg: "",
currentDevice: ''
}, },
//充值记录 //充值记录
RechargeRecord() { RechargeRecord() {
@ -47,55 +48,66 @@ Page({
getPackageList() { getPackageList() {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
mask: true
}) })
let that = this let that = this
util.postUrl(apiArr.getpackageList,{
page_num:that.data.page_num,
page_size:that.data.page_size,
user_id:Number(wx.getStorageSync('userId'))
},res=>{
wx.hideLoading()
let flag
if(res.rows.length == that.data.page_num){
flag = true
}else{
flag = false
}
res.rows.forEach(item=>{
item.checked= false
item.package_icon = util.img_url + item.package_icon
})
that.setData({ that.setData({
packageList:that.data.packageList.concat(res.rows || []), currentDevice: wx.getStorageSync('currentDevice')
flag,
page_num:that.data.page_num + 1
}) })
util.postUrl(apiArr.getpackageList, {
device_id: that.data.currentDevice.device_id
}, res => {
wx.hideLoading()
res.package_icon = util.img_url + res.package_icon
that.setData({
packageList: res
})
}) })
}, },
onChange(e) { onChange(e) {
let that = this let that = this
let packageList = that.data.packageList let packageList = that.data.packageList
let selectPackage let selectPackage = that.data.selectPackage
packageList.forEach(item=>{
item.checked = false packageList.checked = e.detail
})
packageList[e.currentTarget.dataset.idx].checked = e.detail if (e.detail) {
selectPackage = '' selectPackage.discounted_price = packageList.suggested_price
packageList.forEach(item=>{ } else {
if(item.checked){ selectPackage.discounted_price = 0
selectPackage = item
} }
})
that.setData({ that.setData({
packageList, packageList,
selectPackage selectPackage
}) })
}, },
account2() {
let that = this
if (that.data.selectPackage.discounted_price == '0') {
wx.showToast({
title: '请选择套餐',
icon: "none"
})
return
}
util.postUrl(apiArr.createPackageOrder, {
device_id: that.data.currentDevice.device_id,
package_id: that.data.packageList.package_id
}, res => {
that.setData({
orderMsg: res
})
that.getGoodsMsg()
})
},
account() { account() {
let that = this let that = this
console.log(that.data.selectPackage); console.log(that.data.selectPackage);
@ -128,7 +140,6 @@ Page({
}) })
return return
} }
if (!that.data.area) { if (!that.data.area) {
wx.showToast({ wx.showToast({
title: '请选择所在地区', title: '请选择所在地区',
@ -136,7 +147,6 @@ Page({
}) })
return return
} }
if (!that.data.address) { if (!that.data.address) {
wx.showToast({ wx.showToast({
title: '请填写详情地址', title: '请填写详情地址',
@ -145,16 +155,15 @@ Page({
return return
} }
util.postUrl(apiArr.createPackageOrder, { util.postUrl(apiArr.createPackageOrder, {
billing_method:Number(that.data.selectPackage.package_type), billing_method: Number(that.data.packageList.package_type),
is_new: 1, is_new: 1,
order_name:that.data.selectPackage.package_name, order_name: that.data.packageList.package_name,
total_price:Number(that.data.selectPackage.discounted_price), total_price: Number(that.data.packageList.suggested_price),
package_id:that.data.selectPackage.package_id, package_id: that.data.packageList.package_id,
device_customer_name: that.data.name, device_customer_name: that.data.name,
device_customer_phone: that.data.phone, device_customer_phone: that.data.phone,
device_customer_addr: that.data.area + that.data.address, device_customer_addr: that.data.area + that.data.address,
user_id: Number(wx.getStorageSync('userId')) user_id: Number(wx.getStorageSync('userId'))
}, res => { }, res => {
console.log(res, '1123213'); console.log(res, '1123213');
that.setData({ that.setData({
@ -167,10 +176,9 @@ Page({
getGoodsMsg() { getGoodsMsg() {
let that = this let that = this
util.postUrl(apiArr.getCurrentShopMsg, { util.postUrl(apiArr.getCurrentShopMsg, {
dealer_id:Number(that.data.selectPackage.dealer_id), dealer_id: Number(that.data.packageList.dealer_id),
user_id: Number(wx.getStorageSync('userId')), user_id: Number(wx.getStorageSync('userId')),
shop_id: Number(wx.getStorageSync('shopId')), shop_id: Number(wx.getStorageSync('shopId')),
}, res => { }, res => {
that.setData({ that.setData({
goodsMsg: res goodsMsg: res
@ -183,12 +191,12 @@ Page({
let that = this let that = this
util.postUrl2(PayJs.pay, { util.postUrl2(PayJs.pay, {
address: that.data.area + that.data.address, address: that.data.area + that.data.address,
goods_id:that.data.orderMsg.order_name, goods_id: that.data.orderMsg.order_id,
remark: "", remark: "",
subject: that.data.orderMsg.order_name, subject: that.data.orderMsg.order_name,
term_no: that.data.goodsMsg.term_no, term_no: that.data.goodsMsg.term_no,
// total_amount:String(that.data.selectPackage.discounted_price * 100), total_amount: String(that.data.packageList.suggested_price * 100),
total_amount:String(1), // total_amount:String(1),
user: String(wx.getStorageSync('userId')), user: String(wx.getStorageSync('userId')),
merchant_no: that.data.goodsMsg.merchant_no, merchant_no: that.data.goodsMsg.merchant_no,
out_trade_no: String(that.data.orderMsg.order_no), out_trade_no: String(that.data.orderMsg.order_no),
@ -226,6 +234,23 @@ Page({
wx.showToast({ wx.showToast({
title: '支付成功!', title: '支付成功!',
}) })
// wx.requestSubscribeMessage({
// tmplIds: ["2BX7Zh5ccLzmHvvbCHuPWiaoZQyDCGfziCruxUct_EU"],
// success(res) {
// if (res['2BX7Zh5ccLzmHvvbCHuPWiaoZQyDCGfziCruxUct_EU'] === 'accept') {
// console.log('用户同意订阅');
// // 调用后端接口保存用户订阅状态
// }
// },
// })
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
} else { } else {
wx.showToast({ wx.showToast({
title: res.msg, title: res.msg,
@ -286,12 +311,34 @@ Page({
}) })
}, },
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let that = this let that = this
that.setData({
phone: wx.getStorageSync('phone')
})
that.getPackageList() that.getPackageList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**

View File

@ -1,5 +1,5 @@
{ {
"usingComponents": { "usingComponents": {
}, },
"navigationBarTitleText": "套餐购买" "navigationBarTitleText": "续费充值"
} }

View File

@ -1,31 +1,43 @@
<view class="box"> <view class="box">
<view class="filterList"> <view class="filterList">
<view class="filterItem" wx:for="{{packageList}}"> <view class="filterItem">
<van-checkbox value="{{ item.checked }}" shape="square" bind:change="onChange" data-idx="{{index}}" checked-color="#ff512a"> <van-checkbox value="{{ packageList.checked }}" shape="square" bind:change="onChange" data-idx="{{index}}" checked-color="#2583FF">
</van-checkbox> </van-checkbox>
<view class="filterItem_Msg"> <view class="filterItem_Msg">
<view class="filterItem_Img"> <view class="filterItem_Img">
<image src="{{item.package_icon}}" mode="widthFix" /> <image src="{{packageList.package_icon}}" mode="aspectFill" />
</view> </view>
<view class="filterItem_Con"> <view class="filterItem_Con">
<view class="filterItem_Con_tit">{{item.package_name}}</view>
<view class="filterItem_Con_tagList">
<view class="tag">{{item.package_type == 1?'时长模式':'流量模式'}}</view>
<!-- <view class="tag">{{item.package_days}}</view> -->
</view>
<view class="filterItem_Con_msg2">
经销商:{{item.dealer_name}}
</view>
<view class="filterItem_Con_msg"> <view class="filterItem_Con_msg">
¥{{item.discounted_price}} ¥{{packageList.suggested_price}}
</view> </view>
<view class="filterItem_Con_tagList">
{{packageList.package_name}}
<view class="tag">
{{packageList.package_type == 1?'时长模式':'流量模式'}}
</view>
</view>
<view wx:if="{{packageList.package_type == 1}}">
续费时长:{{packageList.package_days}}天
</view>
<view wx:if="{{packageList.package_type != 1}}">
续费流量: {{packageList.package_flow}}
</view>
<view class="filterItem_Con_msg2">
经销商:{{packageList.dealer_name}}
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="gray"></view> <view class="gray"></view>
<view class="form"> <!-- <view class="form">
<view class="formItem"> <view class="formItem">
<view class="formItem_ask">收货人</view> <view class="formItem_ask">收货人</view>
<view class="formItem_con"> <view class="formItem_con">
@ -50,22 +62,20 @@
<input type="text" value="{{address}}" placeholder="请输入详细地址" bindinput="ipt3" /> <input type="text" value="{{address}}" placeholder="请输入详细地址" bindinput="ipt3" />
</view> </view>
</view> </view>
</view> </view> -->
<view class="foot"> <view class="foot">
<view class="foot_mony"> <text>¥</text> {{selectPackage.discounted_price}}</view> <view class="foot_mony"> <text>¥</text> {{selectPackage.discounted_price}}</view>
<view class="foot_btn" bind:tap="account">去结算</view> <!-- <view class="foot_btn" bind:tap="account">去结算</view> -->
<view class="foot_btn" bind:tap="account2">去结算</view>
</view> </view>
</view> </view>
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" <van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom" bind:>
round close-on-click-overlay position="bottom" bind:>
<view style="width: 100%;"> <view style="width: 100%;">
<van-area area-list="{{ areaList }}" bind:confirm="AreaConfirm" bind:cancel="cancel" value="110101" /> <van-area area-list="{{ areaList }}" bind:confirm="AreaConfirm" bind:cancel="cancel" value="110101" />
</view> </view>
</van-popup> </van-popup>

View File

@ -1,6 +1,7 @@
.box { .box {
min-height: 100vh; min-height: 90vh;
padding-bottom: 180rpx; padding-bottom: 180rpx;
box-sizing: border-box;
} }
.nav-box { .nav-box {
@ -70,6 +71,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 10rpx; margin-left: 10rpx;
width: 100%;
} }
.filterItem_Img { .filterItem_Img {
@ -83,8 +85,11 @@
.filterItem_Img image { .filterItem_Img image {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover;
}
.filterItem_Con{
flex: 1;
} }
.filterItem_Con_tit { .filterItem_Con_tit {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
@ -95,24 +100,26 @@
.filterItem_Con_tagList { .filterItem_Con_tagList {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 10rpx;
justify-content: space-between;
} }
.filterItem_Con_tagList .tag { .filterItem_Con_tagList .tag {
font-weight: 400; font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
background: #FFE8E8; background: #2583FF1a;
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
border: 1rpx solid #FF512A; border: 1rpx solid #2583FF;
padding: 0 10rpx; padding: 0 10rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.filterItem_Con_msg { .filterItem_Con_msg {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 40rpx;
color: #FF512A; color: #2583FF;
margin-bottom: 10rpx;
} }
.filterItem_Con_msg2 { .filterItem_Con_msg2 {
@ -120,6 +127,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-top: 10rpx;
} }
.gray { .gray {
@ -189,7 +197,7 @@
.foot_mony { .foot_mony {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -197,7 +205,7 @@
.foot_mony text { .foot_mony text {
font-weight: 400; font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
} }
.foot_btn { .foot_btn {
@ -206,7 +214,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 180rpx; width: 180rpx;
height: 62rpx; height: 62rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -19,17 +19,18 @@ Page({
page_size: 10, page_size: 10,
flag: false, flag: false,
List: [], List: [],
currentDevice:"",
tab: [ tab: [
{ {
name: "全部", name: "全部",
type: "0" type: "0"
}, },
{ {
name:"代支付", name: "待支付",
type: "1" type: "1"
}, },
{ {
name:"代发货", name: "待发货",
type: "2" type: "2"
}, },
{ {
@ -71,12 +72,18 @@ Page({
getPayList() { getPayList() {
let that = this let that = this
util.postUrl(apiArr.getOrderPayList,{ wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.getOrderBuyList, {
page_num: that.data.page_num, page_num: that.data.page_num,
page_size: that.data.page_size, page_size: that.data.page_size,
status: that.data.state, status: that.data.state,
user_id:Number(wx.getStorageSync('userId')) user_id: Number(wx.getStorageSync('userId')),
dealer_id:that.data.currentDevice.dealer_id
}, res => { }, res => {
wx.hideLoading()
if (res.rows) { if (res.rows) {
let flag let flag
if (res.rows.length == that.data.page_size) { if (res.rows.length == that.data.page_size) {
@ -109,21 +116,17 @@ Page({
pay3() { pay3() {
let that = this let that = this
util.postUrl(apiArr.createDeviceOrder,{ util.postUrl(apiArr.createPackageOrder, {
customer_name:that.data.selectPackage.customer_name,
customer_phone:that.data.selectPackage.customer_phone, device_id:that.data.currentDevice.device_id,
total_price:Number(that.data.selectPackage.total_price), package_id:that.data.currentDevice.package_id
parts_ids:that.data.selectPackage.parts_ids,
device_id:Number(wx.getStorageSync('device_id')),
region:that.data.selectPackage.region,
address: that.data.selectPackage.address,
parts_ids:that.data.selectPackage.part_ids,
user_id:Number(wx.getStorageSync('userId'))
}, res => { }, res => {
console.log(res,'asdasd');
that.setData({ that.setData({
orderMsg: res orderMsg: res
}) })
console.log(that.data.orderMsg.order_no);
that.getGoodsMsg() that.getGoodsMsg()
}) })
}, },
@ -145,17 +148,17 @@ Page({
pay() { pay() {
let that = this let that = this
util.postUrl2(PayJs.pay, { util.postUrl2(PayJs.pay, {
address:that.data.orderMsg.Region + that.data.orderMsg.Address, address: '',
goods_id: that.data.orderMsg.order_name, goods_id: that.data.orderMsg.order_name,
remark: "", remark: "",
subject:that.data.orderMsg.OrderName, subject: that.data.orderMsg.order_name,
term_no: that.data.goodsMsg.term_no, term_no: that.data.goodsMsg.term_no,
// total_amount:String(that.data.selectPackage.total_price * 100), total_amount:String(that.data.selectPackage.total_price * 100),
total_amount:String(1), // total_amount: String(1),
user: String(wx.getStorageSync('userId')), user: String(wx.getStorageSync('userId')),
merchant_no: that.data.goodsMsg.merchant_no, merchant_no: that.data.goodsMsg.merchant_no,
out_trade_no:String(that.data.orderMsg.OrderNo), out_trade_no: String(that.data.orderMsg.order_no),
user_id:wx.getStorageSync('openId') user_id: wx.getStorageSync('openId'),
}, res => { }, res => {
const { resp_data, msg } = res.data.data const { resp_data, msg } = res.data.data
if (msg == '成功') { if (msg == '成功') {
@ -209,7 +212,15 @@ queryPay(){
*/ */
onLoad(options) { onLoad(options) {
let that = this let that = this
that.setData({
currentDevice:wx.getStorageSync('currentDevice')
})
that.getPayList() that.getPayList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -261,6 +272,17 @@ queryPay(){
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -20,7 +20,7 @@
<view class="payList"> <view class="payList">
<view class="payItem" wx:if="{{List.length > 0}}" wx:for="{{List}}"> <view class="payItem" wx:if="{{List.length > 0}}" wx:for="{{List}}">
<view class="payItem1"> <view class="payItem1">
<view class="payItem1_time">2024-12-20 10:31:48</view> <!-- <view class="payItem1_time">2024-12-20 10:31:48</view> -->
<view class="payItem1_state1" wx:if="{{item.status == 1}}">待支付</view> <view class="payItem1_state1" wx:if="{{item.status == 1}}">待支付</view>
<view class="payItem1_state1" wx:if="{{item.status == 2}}">代发货</view> <view class="payItem1_state1" wx:if="{{item.status == 2}}">代发货</view>
<view class="payItem1_state1" wx:if="{{item.status == 3}}">已发货</view> <view class="payItem1_state1" wx:if="{{item.status == 3}}">已发货</view>

View File

@ -1,6 +1,9 @@
.box { .box {
background-color: #F9F9F9; background-color: #F9F9F9;
padding-bottom: 40rpx; padding-bottom: 40rpx;
min-height: 90vh;
overflow: hidden;
box-sizing: border-box;
} }
.nav-box { .nav-box {
@ -59,7 +62,7 @@
.payItem1_state1 { .payItem1_state1 {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
} }
.payItem1_state2 { .payItem1_state2 {
@ -106,7 +109,7 @@
.payItem_pay { .payItem_pay {
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
@ -151,7 +154,7 @@
content: ''; content: '';
width: 100%; width: 100%;
height: 10rpx; height: 10rpx;
background: #FF512A; background: #2583FF;
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: -10rpx; bottom: -10rpx;

View File

@ -65,7 +65,7 @@
<view class="deviceInfo_Tit">滤芯信息</view> <view class="deviceInfo_Tit">滤芯信息</view>
<view class="lifetime-progress" wx:for="{{Info.device_part}}"> <view class="lifetime-progress" wx:for="{{Info.device_part}}">
<text class="progress-name">{{item.parts_name}}</text> <text class="progress-name">{{item.parts_name}}</text>
<van-progress percentage="{{item.parent}}" color="linear-gradient(to right, #FFBBAC, #FF512A)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" /> <van-progress percentage="{{item.parent}}" color="linear-gradient(to right, #FFBBAC, #2583FF)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" />
<text class="progress">复位</text> <text class="progress">复位</text>
</view> </view>
</view> </view>

View File

@ -56,7 +56,7 @@ page{
content: ''; content: '';
width: 127rpx; width: 127rpx;
height: 10rpx; height: 10rpx;
background: #FF512A; background: #2583FF;
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
@ -125,7 +125,7 @@ page{
} }
.btn1 { .btn1 {
background: #FF512A; background: #2583FF;
} }
.btn2 { .btn2 {
@ -167,7 +167,7 @@ page{
color: #FFFFFF; color: #FFFFFF;
width: 90rpx; width: 90rpx;
height: 36rpx; height: 36rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -103,12 +103,12 @@ Page({
mask: true mask: true
}) })
let that = this let that = this
let admin = wx.getStorageSync('admin')
let param = { let param = {
page_size: that.data.page_size, page_size: that.data.page_size,
page_num: that.data.page_num, page_num: that.data.page_num,
search: that.data.searchText, search: that.data.searchText,
dealer_id:wx.getStorageSync('dealer_id') dealer_id: admin.shop_id
}; };
if (networkStatus) { if (networkStatus) {
param = { param = {
@ -125,17 +125,17 @@ Page({
util.postUrl(apiArr.deviceList, param, res => { util.postUrl(apiArr.deviceList, param, res => {
wx.hideLoading() wx.hideLoading()
let flag = false let flag = false
if(res.rows && res.rows.length == that.data.page_size){ if (res.rows && res.rows.length == that.data.page_size) {
flag =true flag = true
} else { } else {
flag =false flag = false
} }
that.setData({ that.setData({
deviceList:that.data.deviceList.concat(res.rows|| []), deviceList: that.data.deviceList.concat(res.rows || []),
total: res.total, total: res.total,
flag, flag,
page_num:that.data.page_num + 1 page_num: that.data.page_num + 1
}) })
}) })
}, },
@ -145,6 +145,10 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.getDeviceList(); this.getDeviceList();
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -197,6 +201,17 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -1,12 +1,12 @@
<view class="deviceList"> <view class="deviceList">
<view class="white"> <view class="white">
<view class="deviceImg"> <view class="deviceImg">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList.png" mode="widthFix" /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList.png?1" mode="widthFix" />
</view> </view>
<view class="deviceText">设备总数:{{total}}</view> <view class="deviceText">设备总数:{{total}}</view>
<view class="deviceIpt"> <view class="deviceIpt">
<input type="text" value="{{searchText}}" bindinput="ipt1" placeholder="设备编码/客户手机/客户姓名/设备地址" placeholder-style="color: #999999;font-size: 24rpx;" /> <input type="text" value="{{searchText}}" bindinput="ipt1" placeholder="设备编码/客户手机/客户姓名/设备地址" placeholder-style="color: #999999;font-size: 24rpx;" />
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png" mode="widthFix" /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1?1" mode="widthFix" />
</view> </view>
</view> </view>

View File

@ -2,6 +2,7 @@
.deviceList { .deviceList {
background-color: #F9F9F9; background-color: #F9F9F9;
padding-bottom: 120rpx; padding-bottom: 120rpx;
min-height: 95vh;
} }
.white { .white {

View File

@ -8,7 +8,7 @@
<view wx:if="{{tabIndex == 0}}" style="padding-bottom:180rpx"> <view wx:if="{{tabIndex == 0}}" style="padding-bottom:180rpx">
<view class="filterList"> <view class="filterList">
<view class="filterItem" wx:for="{{3}}"> <view class="filterItem" wx:for="{{3}}">
<van-checkbox value="{{ checked }}" shape="square" bind:change="onChange" checked-color="#ff512a"> <van-checkbox value="{{ checked }}" shape="square" bind:change="onChange" checked-color="#2583FF">
</van-checkbox> </van-checkbox>
<view class="filterItem_Msg"> <view class="filterItem_Msg">
<view class="filterItem_Img"> <view class="filterItem_Img">

View File

@ -96,13 +96,13 @@
} }
.filterItem_Con_tagList .icon { .filterItem_Con_tagList .icon {
color: #FF512A; color: #2583FF;
} }
.filterItem_Con_tagList .money { .filterItem_Con_tagList .money {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
} }
@ -174,7 +174,7 @@
.foot_mony { .foot_mony {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -182,7 +182,7 @@
.foot_mony text { .foot_mony text {
font-weight: 400; font-weight: 400;
font-size: 22rpx; font-size: 22rpx;
color: #FF512A; color: #2583FF;
} }
.foot_btn { .foot_btn {
@ -191,7 +191,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 180rpx; width: 180rpx;
height: 62rpx; height: 62rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -223,7 +223,7 @@
content: ''; content: '';
width: 127rpx; width: 127rpx;
height: 10rpx; height: 10rpx;
background: #FF512A; background: #2583FF;
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
@ -274,7 +274,7 @@
.payItem_tit_state { .payItem_tit_state {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
} }
.payItem_goods { .payItem_goods {
@ -345,7 +345,7 @@
.buy { .buy {
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -61,21 +61,30 @@ Page({
changeDef(e) { changeDef(e) {
let that = this let that = this
wx.showLoading({
title: '切换中...',
mask: true,
})
util.postUrl(apiArr.changeDef, { util.postUrl(apiArr.changeDef, {
device_id: e.currentTarget.dataset.id, device_id: e.currentTarget.dataset.id,
}, res => { }, res => {
console.log(res);
wx.hideLoading()
wx.setStorageSync('device_id', e.currentTarget.dataset.id) wx.setStorageSync('device_id', e.currentTarget.dataset.id)
wx.showToast({
title: '修改默认成功',
})
that.setData({ that.setData({
page_num: 1, page_num: 1,
flag: false, flag: false,
deviceList: [] deviceList: []
}) })
wx.hideLoading()
wx.showToast({
title: '修改默认成功',
})
that.getDeviceList() that.getDeviceList()
wx.navigateBack({
delta: 1
})
}) })
}, },

View File

@ -3,7 +3,7 @@
<view wx:for="{{deviceList}}" class="deviceItemBox {{item.is_first == 1?'active':''}}" bind:tap="changeDef" data-id="{{item.device_id}}" > <view wx:for="{{deviceList}}" class="deviceItemBox {{item.is_first == 1?'active':''}}" bind:tap="changeDef" data-id="{{item.device_id}}" >
<view class="deviceItem"> <view class="deviceItem">
<view class="deviceImg"> <view class="deviceImg">
<image src="{{item.product_icon}}" mode="widthFix" /> <image src="{{item.product_icon}}" mode="aspectFill" />
</view> </view>
<view class="devicemsg"> <view class="devicemsg">
<view class="deviceTit">{{item.product_name}}</view> <view class="deviceTit">{{item.product_name}}</view>

View File

@ -35,7 +35,7 @@ image {
.devicemsg1 view { .devicemsg1 view {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
margin-left: 30rpx; margin-left: 30rpx;
} }
@ -51,7 +51,7 @@ image {
.devicemsg2 text { .devicemsg2 text {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
} }
.devicemsg2 view { .devicemsg2 view {
@ -93,5 +93,5 @@ image {
} }
.active{ .active{
background-color: rgba(255, 145, 119,.2); background-color: rgba(37, 131, 255,.2);
} }

View File

@ -20,19 +20,72 @@ Page({
currentDevice: '', currentDevice: '',
sucessMsg: "", sucessMsg: "",
Info: "", Info: "",
billing_method: "",
},
reset() {
let that = this
util.postUrl(apiArr.resetFilter, {
device_id: that.data.currentFilter.device_id,
part_id: that.data.currentFilter.id,
}, res => {
console.log(res);
if (res.msg == '操作成功') {
wx.showToast({
title: '重置成功!',
icon: "none"
})
that.getfilterList()
} else {
wx.showToast({
title: res.msg,
icon: "none"
})
}
})
},
getDaysBetweenDates(inputDate) {
const currentDate = new Date();
// 将传入的日期字符串转换为日期对象
const targetDate = new Date(inputDate);
// 计算两个日期之间的时间差(以毫秒为单位)
const timeDifference = currentDate - targetDate;
// 将时间差转换为天数
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
// 返回天数
return daysDifference;
},
formatPercentage(value) {
return Math.max(0, Number((value || 0).toFixed(0)));
}, },
getfilterList() { getfilterList() {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
}) })
let that = this let that = this
util.headerStorage(that,'currentDevice',that.data.currentDevice) // util.headerStorage(that, 'currentDevice', that.data.currentDevice)
util.postUrl(apiArr.getFilterListByid, { util.postUrl(apiArr.getFilterListByid, {
device_id: wx.getStorageSync('device_id') device_id: wx.getStorageSync('device_id')
}, res => { }, res => {
wx.hideLoading() wx.hideLoading()
console.log(res,';ssssss'); if (!res.list || !Array.isArray(res.list)) {
return that.setData({ filterList: [] })
}
res.list.forEach(item => {
// 计算已使用天数
item.difDay = that.getDaysBetweenDates(item.start_time || item.create_time);
// 计算剩余天数百分比(剩余天数/总天数)
const remainingDays = Math.max(0, (item.available_days || 0) - (item.difDay || 0));
item.percentageDay = that.formatPercentage(
(remainingDays / (item.available_days || 1)) * 100
);
// 计算剩余容量百分比
item.percentageCapacity = that.formatPercentage(
((item.threshold_volume || 0) / (item.available_volume || 1)) * 100
);
})
that.setData({ that.setData({
filterList: res.list filterList: res.list
}) })
@ -49,6 +102,35 @@ Page({
}) })
}) })
}, },
getFilterInfo2(e) {
let that = this
util.postUrl(apiArr.deviceInfo, {
device_id: e.device_id
}, res => {
that.setData({
Info: res
})
util.postUrl(apiArr.createDeviceOrder, {
device_id: Number(wx.getStorageSync('device_id')),
region: that.data.currentDevice.region,
address: e.address,
parts_ids: String(e.parts_id),
total_price: e.unit_price,
remark: "",
customer_name: String(that.data.Info.customer_name),
customer_phone: String(that.data.Info.customer_phone),
user_id: Number(wx.getStorageSync('userId')),
is_up_door: 1
}, res => {
that.setData({
orderMsg: res
})
that.getGoodsMsg()
})
})
},
showDesc(e) { showDesc(e) {
let that = this let that = this
@ -56,22 +138,31 @@ Page({
show: !that.data.show, show: !that.data.show,
currentFilter: e.currentTarget.dataset.item currentFilter: e.currentTarget.dataset.item
}) })
console.log(that.data.currentFilter);
that.getFilterInfo(e.currentTarget.dataset.item.device_id) that.getFilterInfo(e.currentTarget.dataset.item.device_id)
}, },
pay3(e) {
let that = this
that.setData({
currentFilter: e.currentTarget.dataset.item
})
that.getFilterInfo2(e.currentTarget.dataset.item)
},
pay2() { pay2() {
let that = this let that = this
util.postUrl(apiArr.createDeviceOrder, { util.postUrl(apiArr.createDeviceOrder, {
device_id: Number(wx.getStorageSync('device_id')), device_id: Number(wx.getStorageSync('device_id')),
region:that.data.currentFilter.region, region: that.data.currentDevice.region,
address:that.data.currentFilter.address, address: that.data.currentDevice.address,
parts_ids: String(that.data.currentFilter.parts_id), parts_ids: String(that.data.currentFilter.parts_id),
total_price: that.data.currentFilter.unit_price, total_price: that.data.currentFilter.unit_price,
remark: "", remark: "",
customer_name: String(that.data.Info.customer_name), customer_name: String(that.data.Info.customer_name),
customer_phone: String(that.data.Info.customer_phone), customer_phone: String(that.data.Info.customer_phone),
user_id: Number(wx.getStorageSync('userId')), user_id: Number(wx.getStorageSync('userId')),
is_up_door: 1
}, res => { }, res => {
that.setData({ that.setData({
orderMsg: res orderMsg: res
@ -86,7 +177,6 @@ Page({
dealer_id: Number(that.data.orderMsg.DealerId), dealer_id: Number(that.data.orderMsg.DealerId),
user_id: Number(wx.getStorageSync('userId')), user_id: Number(wx.getStorageSync('userId')),
shop_id: Number(wx.getStorageSync('shopId')), shop_id: Number(wx.getStorageSync('shopId')),
}, res => { }, res => {
that.setData({ that.setData({
GoodsMsg: res GoodsMsg: res
@ -98,7 +188,7 @@ pay(){
let that = this let that = this
util.postUrl2(PayJs.pay, { util.postUrl2(PayJs.pay, {
address: that.data.currentFilter.address, address: that.data.currentFilter.address,
goods_id:String(that.data.orderMsg.DealerId), goods_id: String(that.data.orderMsg.OrderId),
merchant_no: that.data.GoodsMsg.merchant_no, merchant_no: that.data.GoodsMsg.merchant_no,
out_trade_no: that.data.orderMsg.OrderNo, out_trade_no: that.data.orderMsg.OrderNo,
quantity: 1, quantity: 1,
@ -144,6 +234,14 @@ queryPay(){
wx.showToast({ wx.showToast({
title: '支付成功!', title: '支付成功!',
}) })
that.setData({
show:false
})
// wx.requestSubscribeMessage({
// tmplIds:["5yPg-WOoP9-9ZU1fHjC4zg1KNaPWb76K87JzzKb58f0"]
// })
that.getfilterList() that.getfilterList()
} else { } else {
wx.showToast({ wx.showToast({
@ -188,7 +286,14 @@ changeOrderState(){
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
this.setData({
billing_method: wx.getStorageSync('billing_method'),
currentDevice: wx.getStorageSync('currentDevice')
})
}, },
/** /**
@ -238,6 +343,17 @@ changeOrderState(){
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -7,9 +7,8 @@
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;"> <view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;">
滤芯详情 滤芯详情
</view> </view>
<view class="nav-bar-right" bind:tap="getfilterList"> <view class="nav-bar-right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_refresh.png" mode="widthFix" />
刷新
</view> </view>
</view> </view>
</view> </view>
@ -28,14 +27,35 @@
</view> </view>
<view class="filter_Item_Info_msg"> <view class="filter_Item_Info_msg">
<view class="filter_Item_Info_name">{{item.parts_name}}</view> <view class="filter_Item_Info_name">{{item.parts_name}}</view>
<view class="filter_Item_Info_desc">剩余可用{{item.available_days}}天</view>
<view style="display: flex;align-items: center;width: 100%;">
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
{{item.percentageDay}}%
</view>
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 1}}">
<view class="hide"></view>
<view class="filter_Item_Info_descText">
剩余可用{{item.remaining_days}}天
</view> </view>
</view> </view>
<view class="filter_Item_more" > <view class="filter_Item_Info_desc" wx:if="{{billing_method == 2}}">
{{item.remaining_volume}}% <view class="hide"></view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/filter_more.png" mode="widthFix" /> <view class="filter_Item_Info_descText">
剩余流量{{item.remaining_volume}}
</view> </view>
</view> </view>
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 3}}">
<view class="payBtn" catch:tap="pay3" data-item="{{item}}">购买</view>
<view class="filter_Item_Info_descText">剩余可用{{item.remaining_days}}天</view>
</view>
</view>
</view>
</view>
</view> </view>
<view wx:if="{{filterList.length == 0}}"> <view wx:if="{{filterList.length == 0}}">
@ -48,11 +68,14 @@
<van-popup show="{{ show }}" bind:close="onClose" round close-on-click-overlay> <van-popup show="{{ show }}" bind:close="onClose" round close-on-click-overlay>
<view class="popView"> <view class="popView">
<view class="pop_cir"> <view class="pop_cir">
<van-circle value="{{currentFilter.remaining_volume}}" size="120" color="#f4f4f4" stroke-width="9" layer-color="#FFD5D5"> <van-circle wx:if="{{billing_method == 1}}" value="{{currentFilter.percentageDay}}" size="120" color="#FFD5D5" stroke-width="9" layer-color="#f4f4f4">
</van-circle>
<van-circle wx:if="{{billing_method != 1}}" value="{{currentFilter.percentageCapacity}}" size="120" color="#FFD5D5" stroke-width="9" layer-color="#f4f4f4">
</van-circle> </van-circle>
<view class="cir_msg"> <view class="cir_msg">
<view class="percentage">{{currentFilter.remaining_volume}}%</view> <view class="percentage" wx:if="{{billing_method == 1}}">{{currentFilter.percentageDay}}%</view>
<view class="percentage" wx:if="{{billing_method != 1}}">{{currentFilter.percentageCapacity}}%</view>
<view class="cir_msg_text">滤芯寿命</view> <view class="cir_msg_text">滤芯寿命</view>
<view class="cir_msg_text2">{{currentFilter.available_days}}天</view> <view class="cir_msg_text2">{{currentFilter.available_days}}天</view>
</view> </view>
@ -61,6 +84,7 @@
<view class="pop_Tit">{{currentFilter.parts_name}}</view> <view class="pop_Tit">{{currentFilter.parts_name}}</view>
<view class="pop_msg">{{currentFilter.introduce}}</view> <view class="pop_msg">{{currentFilter.introduce}}</view>
<view class="pop_btn" bind:tap="pay2">购买</view> <view class="pop_btn" bind:tap="pay2" wx:if="{{currentFilter.status != 2}}">购买</view>
<view class="pop_btn" bind:tap="reset" wx:if="{{currentFilter.status == 2}}">重置</view>
</view> </view>
</van-popup> </van-popup>

View File

@ -1,5 +1,5 @@
.box { .box {
min-height: 100vh; min-height: 90vh;
} }
.nav-box { .nav-box {
@ -38,7 +38,7 @@
.nav-box .nav-bar-right { .nav-box .nav-bar-right {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -81,7 +81,8 @@
.filter_Item_Info { .filter_Item_Info {
display: flex; display: flex;
align-items: center; /* align-items: center; */
width: 100%;
} }
.filter_Item_Info_image { .filter_Item_Info_image {
@ -90,14 +91,20 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient(180deg, #FF512A 0%, #FF896F 100%); background: linear-gradient(180deg, #2583FF 0%, #FF896F 100%);
border-radius: 50%; border-radius: 50%;
margin-right: 20rpx; margin-right: 20rpx;
margin-top: 10rpx;
}
.filter_Item_Info_msg{
/* width: 100%; */
flex: 1;
} }
.filter_Item_Info_image image { .filter_Item_Info_image image {
width: 20rpx; width: 20rpx;
height: 30rpx; height: 30rpx;
} }
.filter_Item_Info_name { .filter_Item_Info_name {
@ -111,8 +118,28 @@
font-size: 22rpx; font-size: 22rpx;
color: #999999; color: #999999;
margin-top: 10rpx; margin-top: 10rpx;
text-align: right;
display: flex;
align-items: center;
justify-content: space-between;
} }
.hide{
visibility: hidden;
}
.payBtn{
width: 120rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #2887ff;
color: #fff;
border-radius: 30rpx;
}
.filter_Item_more { .filter_Item_more {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
@ -176,7 +203,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #D5AC66; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
@ -200,14 +227,14 @@
.percentage { .percentage {
font-weight: 400; font-weight: 400;
font-size: 34rpx; font-size: 34rpx;
color: #FF512A; color: #2583FF;
white-space: nowrap; white-space: nowrap;
} }
.cir_msg_text { .cir_msg_text {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #FF512A; color: #2583FF;
white-space: nowrap; white-space: nowrap;
} }
.cir_msg_text2{ .cir_msg_text2{

View File

@ -0,0 +1,275 @@
// pages/water_filter/RechargeRecord/RechargeRecord.js
const app = getApp()
let util = require('../../../../utils/util')
let apiArr = require('../../../../api/water_filter')
let PayJs = require('../../../../api/pay')
Page({
/**
* 页面的初始数据
*/
data: {
s: app.system.statusBarHeight, // 状态栏高度
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
t: app.menu.top, // 胶囊局顶部距离
h: app.menu.height, // 胶囊高度
page_num: 1,
page_size: 10,
flag: false,
List: [],
tab: [
{
name: "全部",
type: "0"
},
{
name: "待分配",
type: "1"
},
{
name: "待更换",
type: "2"
},
{
name: "已完成",
type: "3"
},
{
name: "已取消",
type: "4"
}
],
state: 0,
selectPackage: ""
},
changeTab(e) {
console.log(e);
let that = this
that.setData({
state: e.currentTarget.dataset.tab,
flag: false,
page_num: 1,
List: []
})
that.getPayList()
},
getPayList() {
wx.showLoading({
title: '加载中...',
mask:true
})
let that = this
util.postUrl(apiArr.getFilterChangeList, {
page_num: that.data.page_num,
page_size: that.data.page_size,
status: that.data.state,
user_id: Number(wx.getStorageSync('userId'))
}, res => {
wx.hideLoading()
if (res.rows) {
let flag
if (res.rows.length == that.data.page_size) {
flag = true
} else {
flag = false
}
res.rows.forEach(item => {
console.log(item, 'item');
if (item.part_list) {
item.part_ids = item.part_list.map(items => items.parts_id).join(',')
}
})
that.setData({
flag,
List: that.data.List.concat(res.rows || []),
page_num: that.data.page_num + 1
})
}
})
},
pay2(e) {
let that = this
that.setData({
selectPackage: e.currentTarget.dataset.item
})
that.pay3()
},
pay3() {
let that = this
util.postUrl(apiArr.createDeviceOrder, {
customer_name: that.data.selectPackage.customer_name,
customer_phone: that.data.selectPackage.customer_phone,
total_price: Number(that.data.selectPackage.total_price),
parts_ids: that.data.selectPackage.parts_ids,
device_id: Number(wx.getStorageSync('device_id')),
region: that.data.selectPackage.region,
address: that.data.selectPackage.address,
parts_ids: that.data.selectPackage.part_ids,
user_id: Number(wx.getStorageSync('userId'))
}, res => {
that.setData({
orderMsg: res
})
that.getGoodsMsg()
})
},
//获取商户id
getGoodsMsg() {
let that = this
util.postUrl(apiArr.getCurrentShopMsg, {
dealer_id: Number(that.data.selectPackage.dealer_id),
shop_id: Number(wx.getStorageSync('shopId')),
}, res => {
that.setData({
goodsMsg: res
})
that.pay()
})
},
//预支付
pay() {
let that = this
util.postUrl2(PayJs.pay, {
address: that.data.orderMsg.Region + that.data.orderMsg.Address,
goods_id: that.data.orderMsg.order_name,
remark: "",
subject: that.data.orderMsg.OrderName,
term_no: that.data.goodsMsg.term_no,
total_amount:String(that.data.selectPackage.total_price * 100),
// total_amount: String(1),
user: String(wx.getStorageSync('userId')),
merchant_no: that.data.goodsMsg.merchant_no,
out_trade_no: String(that.data.orderMsg.OrderNo),
user_id: wx.getStorageSync('openId')
}, res => {
const { resp_data, msg } = res.data.data
if (msg == '成功') {
wx.requestPayment({
timeStamp: String(resp_data.acc_resp_fields.time_stamp),
nonceStr: String(resp_data.acc_resp_fields.nonce_str),
package: String(resp_data.acc_resp_fields.package),
signType: String(resp_data.acc_resp_fields.sign_type),
paySign: String(resp_data.acc_resp_fields.pay_sign),
success(res) {
that.queryPay()
},
fail(fal) {
console.log(fal);
}
})
}
})
},
//查询支付结果
queryPay() {
let that = this
util.postUrl2(PayJs.queryPay, {
merchant_no: that.data.goodsMsg.merchant_no,
term_no: that.data.goodsMsg.term_no,
out_trade_no: that.data.orderMsg.OrderNo,
}, res => {
if (res.statusCode == '200') {
wx.showToast({
title: '支付成功!',
})
that.setData({
flag: false,
page_num: 1,
List: []
})
this.getPayList()
} else {
wx.showToast({
title: res.msg,
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this
that.getPayList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
let that = this
if (that.data.flag) {
that.getPayList()
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
}
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
})

View File

@ -0,0 +1,6 @@
{
"usingComponents": {
"Footer":"/component/footer/index"
},
"navigationBarTitleText": "滤芯更换记录"
}

View File

@ -0,0 +1,44 @@
<view class="box">
<view class="tabs">
<scroll-view scroll-x class="scroll-view">
<view wx:for="{{tab}}" class="tab {{state == index?'active':''}}" bind:tap="changeTab" data-tab="{{index}}">{{item.name}}</view>
</scroll-view>
</view>
<view class="payList">
<view class="payItem" wx:if="{{List.length > 0}}" wx:for="{{List}}">
<view class="payItem_row">
<view class="payItem_title">配件更换订单</view>
<view class="payItem_con">{{item.replace_name}}</view>
</view>
<view class="payItem_row">
<view class="payItem_title">经销商名称</view>
<view class="payItem_con">{{item.dealer_name}}</view>
</view>
<view class="payItem_row">
<view class="payItem_title">客户名称</view>
<view class="payItem_con">{{item.customer_name}}</view>
</view>
<view class="payItem_row">
<view class="payItem_title">客户联系方式</view>
<view class="payItem_con">{{item.customer_phone}}</view>
</view>
<view class="payItem_row">
<view class="payItem_title">状态</view>
<view class="payItem_con" wx:if="{{item.status == 1}}">待分配</view>
<view class="payItem_con" wx:if="{{item.status == 2}}">待更换</view>
<view class="payItem_con" wx:if="{{item.status == 3}}">已完成</view>
<view class="payItem_con" wx:if="{{item.status == 4}}">已取消</view>
</view>
<van-divider />
</view>
<van-empty description="暂无内容" wx:if="{{List.length == 0}}" />
</view>
</view>

View File

@ -0,0 +1,171 @@
.box {
background-color: #F9F9F9;
padding-bottom: 40rpx;
min-height: 90vh;
}
.nav-box {
box-sizing: border-box;
width: 100%;
z-index: 2;
background: #F9F9F9;
padding-bottom: 25rpx;
}
.nav-box .nav-bar {
display: flex;
align-items: center;
}
.nav-box .nav-bar .nav-bar-left,
.nav-box .nav-bar .nav-bar-right {
padding: 0 20rpx;
min-width: 36rpx;
}
.nav-box .nav-bar .nav-bar-left van-icon {
vertical-align: sub;
color: #333333;
}
.nav-box .nav-bar .nav-bar-title {
flex: 1;
text-align: center;
font-weight: 400;
font-size: 36rpx;
color: #000000;
}
.nav-box .nav-bar-title {}
.payItem {
padding: 30rpx 20rpx;
background-color: #fff;
margin-bottom: 30rpx;
}
.payItem1 {
display: flex;
align-items: center;
justify-content: space-between;
}
.payItem1_time {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.payItem1_state1 {
font-weight: 400;
font-size: 26rpx;
color: #2583FF;
}
.payItem1_state2 {
font-weight: 400;
font-size: 26rpx;
color: #D5AC66;
}
.payItem1_state3 {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.payItem1_state4 {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.payItem_row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
}
.payItem_title {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.payItem_con {
font-weight: 400;
font-size: 26rpx;
color: #222222;
}
.payItem_payBox{
display: flex;
justify-content: flex-end;
margin-right: -4rpx;
}
.payItem_pay {
width: 150rpx;
height: 50rpx;
background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400;
font-size: 26rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.tabs {
display: flex;
align-items: center;
margin-left: 20rpx;
padding-top: 30rpx;
margin-bottom: 30rpx;
}
.scroll-view {
white-space: nowrap; /* 禁止换行 */
width: 100%;
height: 60rpx;
}
.scroll-view .tab {
font-weight: 400;
font-size: 28rpx;
color: #555555;
margin-right: 70rpx;
white-space: nowrap;
display: inline-block;
}
.scroll-view .active {
font-weight: bold;
font-size: 32rpx;
position: relative;
}
.scroll-view .active::after {
content: '';
width: 100%;
height: 10rpx;
background: #2583FF;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}
.scroll-view .active::before {
width: 100%;
height: 10rpx;
filter: blur(6.599999904632568rpx);
background: #FF5D73;
position: absolute;
left: 50%;
bottom: -10rpx;
transform: translateX(-50%);
}

View File

@ -36,7 +36,7 @@
justify-content: center; justify-content: center;
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
margin: 0 auto; margin: 0 auto;
margin-top: 30rpx; margin-top: 30rpx;

View File

@ -27,7 +27,7 @@
.payItem_tit_state { .payItem_tit_state {
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
} }
.payItem_goods { .payItem_goods {
@ -98,7 +98,7 @@
.buy { .buy {
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -143,7 +143,12 @@ Page({
beforeRead(e){ beforeRead(e){
console.log(e); console.log(e);
let that = this let that = this
wx.showLoading({
title: '上传中',
mask:true,
})
util.uploadFileUrl(e.detail.file.url,(res)=>{ util.uploadFileUrl(e.detail.file.url,(res)=>{
wx.hideLoading()
let datas = JSON.parse(res) let datas = JSON.parse(res)
console.log(datas.data); console.log(datas.data);
let url = util.img_url + datas.data.path let url = util.img_url + datas.data.path
@ -168,9 +173,10 @@ Page({
submit(){ submit(){
const {selectEquipment, name, phone, time, message, fileList2} = this.data; const {selectEquipment, name, phone, time, message, fileList2} = this.data;
if (!selectEquipment.customer_name) {
if (!selectEquipment.device_id) {
wx.showToast({ wx.showToast({
title: '请选择修设备', title: '请选择修设备',
icon:"none" icon:"none"
}) })
return return
@ -205,7 +211,7 @@ Page({
} }
if(!message){ if(!message){
wx.showToast({ wx.showToast({
title: '请填写修内容', title: '请填写修内容',
icon:"none" icon:"none"
}) })
return return
@ -221,7 +227,7 @@ Page({
customer_phone: phone, customer_phone: phone,
device_id: selectEquipment.device_id, device_id: selectEquipment.device_id,
fault_desc: message, fault_desc: message,
photos: fileList2.length !== 0 ? fileList2[0].url : '', fault_imgs: fileList2.length !== 0 ? fileList2[0].url : '',
user_id:Number(wx.getStorageSync('userId')) user_id:Number(wx.getStorageSync('userId'))
},res=>{ },res=>{
@ -245,23 +251,33 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.init(); this.init();
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
init() { init() {
wx.showLoading({
title: '加载中...',
mask:true
})
postUrl(apiArr.BXDeviceList, { postUrl(apiArr.BXDeviceList, {
page_num: 1, page_num: 1,
page_size: 50, //TODO: 临时写一次获取50个后续优化 page_size: 50, //TODO: 临时写一次获取50个后续优化
user_id:Number(wx.getStorageSync('userId')) user_id:Number(wx.getStorageSync('userId'))
}, res => { }, res => {
console.log('11111', res); wx.hideLoading()
if(res.msg == '操作成功'){
if(res.rows){ if(res.rows){
res.rows.forEach(item=>{ res.rows.forEach(item=>{
item.product_icon = util.img_url + item.product_icon item.product_icon = util.img_url + item.product_icon
}) })
}
this.setData({ this.setData({
equipmentList: res.rows || [] equipmentList: res.rows || []
}) })
}
}
}) })
}, },
@ -298,7 +314,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
@ -338,6 +353,17 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage(){ onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -7,7 +7,7 @@
<view class="information_row" bindtap="headerEquipmentPopupClick"> <view class="information_row" bindtap="headerEquipmentPopupClick">
<view class="information_tit">设备型号</view> <view class="information_tit">设备型号</view>
<view class="information_ipt"> <view class="information_ipt">
<input type="text" value="{{selectEquipment.product_name}}" placeholder="请填写您的设备型号" disabled placeholder-class="information_ipt_pla" /> <input type="text" value="{{selectEquipment.device_code}}" placeholder="请填写您的设备型号" disabled placeholder-class="information_ipt_pla" />
</view> </view>
</view> </view>
@ -73,8 +73,6 @@
</view> </view>
<van-popup show="{{ DoorTimeShow }}" close-on-click-overlay position="bottom" custom-style="height: 40%;" bind:close="onClose"> <van-popup show="{{ DoorTimeShow }}" close-on-click-overlay position="bottom" custom-style="height: 40%;" bind:close="onClose">
<van-datetime-picker <van-datetime-picker
formatter="{{ formatter }}" formatter="{{ formatter }}"
@ -99,7 +97,7 @@
</view> </view>
<view class="equip_item {{index === equipmentList.length -1 && 'no_bottom'}}" wx:for="{{equipmentList}}" wx:key="index" bindtap="headerSelectClick" data-item="{{item}}"> <view class="equip_item {{index === equipmentList.length -1 && 'no_bottom'}}" wx:for="{{equipmentList}}" wx:key="index" bindtap="headerSelectClick" data-item="{{item}}">
<image class="equip_pic" src="{{item.product_icon}}" mode=""/> <image class="equip_pic" src="{{item.product_icon}}" mode=""/>
<view class="equip_desc">{{item.product_name}}</view> <view class="equip_desc">{{item.device_code}}</view>
</view> </view>
</view> </view>
</van-popup> </van-popup>

View File

@ -102,6 +102,13 @@
color: #222222; color: #222222;
} }
.containerMsg .van-field{
height: 100%;
}
.containerMsg .van-field{
height: 100%;
}
.uploadImg { .uploadImg {
padding-top: 30rpx; padding-top: 30rpx;
padding-left: 20rpx; padding-left: 20rpx;
@ -121,7 +128,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -166,7 +173,7 @@
margin-top: 73rpx; margin-top: 73rpx;
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #FF512A; color: #2583FF;
text-decoration: underline; text-decoration: underline;
/* line-height: 30rpx; */ /* line-height: 30rpx; */
} }

View File

@ -16,7 +16,7 @@
.btn1 { .btn1 {
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
font-weight: 400; font-weight: 400;
font-size: 36rpx; font-size: 36rpx;
@ -33,14 +33,14 @@
width: 650rpx; width: 650rpx;
height: 80rpx; height: 80rpx;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
border: 1rpx solid #FF512A; border: 1rpx solid #2583FF;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-weight: 400; font-weight: 400;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
margin: 0 auto; margin: 0 auto;
margin-top: 40rpx; margin-top: 40rpx;
} }

View File

@ -336,7 +336,7 @@ function initChart(canvas, width, height, dpr) {
color: '#FFBBAC', color: '#FFBBAC',
},{ },{
offset: 1, offset: 1,
color: '#FF512A' color: '#2583FF'
}] }]
}, },
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下) barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)

View File

@ -92,7 +92,7 @@
<view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view> <view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view>
<view class="lifetime-progress" wx:for="{{progress_List}}"> <view class="lifetime-progress" wx:for="{{progress_List}}">
<text class="progress-name">{{item.name}}</text> <text class="progress-name">{{item.name}}</text>
<van-progress percentage="{{item.progress}}" color="linear-gradient(to right, #FFBBAC, #FF512A)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" /> <van-progress percentage="{{item.progress}}" color="linear-gradient(to right, #FFBBAC, #2583FF)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" />
<text class="progress">{{item.progress}}%</text> <text class="progress">{{item.progress}}%</text>
</view> </view>

View File

@ -212,7 +212,7 @@
} }
.device-id { .device-id {
color: #FF512A; color: #2583FF;
/* display: inline; */ /* display: inline; */
} }
@ -222,7 +222,7 @@
} }
.day-num { .day-num {
color: #FF512A; color: #2583FF;
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
margin: 0 7rpx 0 8rpx; margin: 0 7rpx 0 8rpx;
@ -357,7 +357,7 @@
text-align: center; text-align: center;
font-size: 38rpx; font-size: 38rpx;
font-weight: bold; font-weight: bold;
color: #FF512A; color: #2583FF;
} }
.water-consumption-col-num-size { .water-consumption-col-num-size {
@ -432,7 +432,7 @@
.water-consumption-col .water-consumption-col-num { .water-consumption-col .water-consumption-col-num {
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
} }
.equi-contral { .equi-contral {

View File

@ -30,7 +30,7 @@ function initChart(canvas, width, height, dpr) {
color: '#FFBBAC', color: '#FFBBAC',
},{ },{
offset: 1, offset: 1,
color: '#FF512A' color: '#2583FF'
}] }]
}, },
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下) barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)

View File

@ -47,7 +47,7 @@ Page({
addOrder(){ addOrder(){
wx.navigateTo({ wx.navigateTo({
url: '../newUpKeep/newUpKeep', url: '/packages/partner/pages/addNewOrder/addNewOrder',
}) })
}, },
@ -77,7 +77,7 @@ Page({
mask: true mask: true
}) })
util.postUrl(apiArr.RecallRepair,{ util.postUrl4(apiArr.RecallRepair,{
status: 4, status: 4,
repair_id: item.repair_id, repair_id: item.repair_id,
},res=>{ },res=>{
@ -113,12 +113,13 @@ Page({
title: '加载中...', title: '加载中...',
mask: true mask: true
}); });
console.log(that.data.page_size,'page_size');
let admin = wx.getStorageSync('admin')
let param = { let param = {
status:that.data.value1, status:that.data.value1,
page_num:that.data.page_num, page_num:that.data.page_num,
page_size:that.data.page_size, page_size:that.data.page_size,
dealer_id:wx.getStorageSync('dealer_id') dealer_id:admin.shop_id
}; };
if(name) { if(name) {
param = { param = {
@ -127,7 +128,7 @@ Page({
} }
}; };
util.postUrl(apiArr.OrderList,param,res=>{ util.postUrl4(apiArr.OrderList,param,res=>{
console.log('rererererererere', res); console.log('rererererererere', res);
wx.hideLoading() wx.hideLoading()
let flag = false let flag = false
@ -164,7 +165,7 @@ Page({
mask: true mask: true
}) })
util.postUrl(apiArr.MasterList,{ util.postUrl4(apiArr.MasterList,{
page_num:1, page_num:1,
page_size:100, page_size:100,
dealer_id:wx.getStorageSync('dealer_id') dealer_id:wx.getStorageSync('dealer_id')
@ -202,7 +203,7 @@ sure(){
that.setData({ that.setData({
show:false show:false
}) })
util.postUrl(apiArr.orderRepairAssign,{ util.postUrl4(apiArr.orderRepairAssign,{
master_id: checkedMaster.info_id, master_id: checkedMaster.info_id,
repair_id: sendOrders.repair_id, repair_id: sendOrders.repair_id,
dealer_id: Number(wx.getStorageSync('dealer_id')) dealer_id: Number(wx.getStorageSync('dealer_id'))
@ -239,6 +240,10 @@ sure(){
// that.getFootNav() // that.getFootNav()
// that.getOrderList() // that.getOrderList()
// that.getMasterList() // that.getMasterList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -296,6 +301,17 @@ sure(){
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage(){ onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -3,7 +3,7 @@
<view class="upkeep_select"> <view class="upkeep_select">
<view class="ipt"> <view class="ipt">
<input type="text" placeholder="请输入客户姓名" placeholder-style="color: #999999;font-size: 24rpx;" bind:input="headerInputClick" /> <input type="text" placeholder="请输入客户姓名" placeholder-style="color: #999999;font-size: 24rpx;" bind:input="headerInputClick" />
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png" mode="widthFix " /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix " />
</view> </view>
新增 新增
</view> </view>

View File

@ -84,7 +84,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -107,7 +107,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
background: #FF512A; background: #2583FF;
position: fixed; position: fixed;
right: 55rpx; right: 55rpx;
bottom: 200rpx; bottom: 200rpx;
@ -119,7 +119,8 @@
.addBtn::after { .addBtn::after {
content: ''; content: '';
background: rgba(255, 81, 42, 0.5); /* background: rgba(77, 154, 255,.5); */
background: rgba(77, 154, 255,.5);
filter: blur(10.899999618530273rpx); filter: blur(10.899999618530273rpx);
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
@ -152,7 +153,7 @@
transform: translateY(-50%); transform: translateY(-50%);
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #FF512A; color: #2583FF;
position: absolute; position: absolute;
} }
@ -184,7 +185,7 @@
.cir1 { .cir1 {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
background: #FF512A; background: #2583FF;
box-sizing: border-box; box-sizing: border-box;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -330,7 +330,7 @@ function initChart(canvas, width, height, dpr) {
color: '#FFBBAC', color: '#FFBBAC',
},{ },{
offset: 1, offset: 1,
color: '#FF512A' color: '#2583FF'
}] }]
}, },
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下) barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)

View File

@ -130,7 +130,7 @@
<view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view> <view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view>
<view class="lifetime-progress" wx:for="{{progress_List}}" wx:key="index"> <view class="lifetime-progress" wx:for="{{progress_List}}" wx:key="index">
<text class="progress-name">{{item.name}}</text> <text class="progress-name">{{item.name}}</text>
<van-progress percentage="{{item.progress}}" color="linear-gradient(to right, #FFBBAC, #FF512A)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" /> <van-progress percentage="{{item.progress}}" color="linear-gradient(to right, #FFBBAC, #2583FF)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" />
<text class="progress">{{item.progress}}%</text> <text class="progress">{{item.progress}}%</text>
</view> </view>

View File

@ -215,7 +215,7 @@
} }
.device-id { .device-id {
color: #FF512A; color: #2583FF;
/* display: inline; */ /* display: inline; */
} }
@ -225,7 +225,7 @@
} }
.day-num { .day-num {
color: #FF512A; color: #2583FF;
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
margin: 0 7rpx 0 8rpx; margin: 0 7rpx 0 8rpx;
@ -359,7 +359,7 @@
text-align: center; text-align: center;
font-size: 38rpx; font-size: 38rpx;
font-weight: bold; font-weight: bold;
color: #FF512A; color: #2583FF;
} }
.water-consumption-col-num-size { .water-consumption-col-num-size {
@ -434,7 +434,7 @@
.water-consumption-col .water-consumption-col-num { .water-consumption-col .water-consumption-col-num {
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
color: #FF512A; color: #2583FF;
} }
.equi-contral { .equi-contral {

View File

@ -3,7 +3,7 @@ let apiArr = require('../../../api/water_filter')
Page({ Page({
data: { data: {
avatarUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/person/Group_309.png', avatarUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/person/Group_309.png?2',
userInfo: { userInfo: {
name: '张三', name: '张三',
phone: '13800138000' phone: '13800138000'
@ -17,6 +17,14 @@ Page({
sexOptions: ['男', '女'], sexOptions: ['男', '女'],
avatarUrl2:"" avatarUrl2:""
}, },
SubscribeMessage(){
wx.navigateTo({
url: '/pages/SubscribeMessage/SubscribeMessage',
})
},
changeSex(e) { changeSex(e) {
const sexIndex = e.detail.value; const sexIndex = e.detail.value;
this.setData({ this.setData({
@ -26,11 +34,35 @@ Page({
// 这里可以添加保存性别到服务器的逻辑 // 这里可以添加保存性别到服务器的逻辑
}, },
deviceList(){
wx.navigateTo({
url: '../device/index',
})
},
loginOut(){
wx.removeStorageSync('is_master')
wx.redirectTo({
url:"/pages/chooseEntrance/chooseEntrance"
})
},
editMaster(){
wx.navigateTo({
url: '/packages/master/masterInfo/index',
})
},
getMasterInfo() { getMasterInfo() {
let that = this let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.masterInfo, { util.postUrl(apiArr.masterInfo, {
user_id: wx.getStorageSync('userId') user_id: wx.getStorageSync('userId')
}, res => { }, res => {
wx.hideLoading()
wx.setStorageSync('master', res) wx.setStorageSync('master', res)
that.setData({ that.setData({
userInfo: res, userInfo: res,
@ -87,6 +119,11 @@ Page({
that.getMasterInfo() that.getMasterInfo()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
// 选择头像 // 选择头像
@ -118,5 +155,20 @@ Page({
}) })
} }
}); });
},
onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}); });

View File

@ -1,3 +1,5 @@
{ {
"usingComponents": {} "usingComponents": {
"Footer":"/component/masterFooter/index"
}
} }

View File

@ -1,33 +1,50 @@
<view class="container"> <view class="container">
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="user-info"> <view class="user-info">
<view class="avatar-box" bindtap="chooseAvatar"> <view class="avatar-box">
<image class="avatar" src="{{avatarUrl}}" mode="aspectFill" /> <image class="avatar" src="{{avatarUrl}}" mode="aspectFill" />
<view class="upload-tip">点击上传</view> <!-- <view class="upload-tip">点击上传</view> -->
</view> </view>
<view class="user-detail"> <view class="user-detail">
<view class="info-item"> <view class="info-item">
<text class="label">姓名:</text> <text class="label">姓名:</text>
<input value="{{userInfo.name}}" bindinput="updateName" placeholder="请输入姓名" /> <input value="{{userInfo.name}}" disabled bindinput="updateName" placeholder="请输入姓名" />
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">性别:</text> <text class="label">性别:</text>
<picker mode="selector" range="{{sexOptions}}" value="{{sexIndex}}" bindchange="changeSex"> <picker mode="selector" disabled range="{{sexOptions}}" value="{{sexIndex}}" bindchange="changeSex">
<view class="value">{{sexOptions[sexIndex]}}</view> <view class="value">{{sexOptions[sexIndex]}}</view>
</picker> </picker>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">手机号:</text> <text class="label">手机号:</text>
<input value="{{userInfo.phone}}" bindinput="updatePhone" placeholder="请输入手机号" /> <input value="{{userInfo.phone}}" disabled bindinput="updatePhone" placeholder="请输入手机号" />
</view> </view>
</view> </view>
<view class="editMaster" bind:tap="editMaster">
修改
</view>
</view>
<view class="btn" bind:tap="deviceList">
设备管理
</view>
<view class="btn" bind:tap="SubscribeMessage">
消息订阅
</view>
<view class="btn" bind:tap="loginOut">
退出登录
</view>
</view> </view>
</view>
<!-- 工单统计 --> <!-- 工单统计 -->
<view class="order-stats"> <!-- <view class="order-stats">
<view class="stat-item"> <view class="stat-item">
<view class="stat-value">{{userInfo.total_order_install_cnt}}</view> <view class="stat-value">{{userInfo.total_order_install_cnt}}</view>
<view class="stat-label">新装工单</view> <view class="stat-label">新装工单</view>
@ -40,7 +57,9 @@
<view class="stat-value">{{userInfo.total_order_repair_cnt}}</view> <view class="stat-value">{{userInfo.total_order_repair_cnt}}</view>
<view class="stat-label">维修工单</view> <view class="stat-label">维修工单</view>
</view> </view>
</view> </view> -->
<!-- 保存按钮 --> <!-- 保存按钮 -->
<view class="save-btn" bindtap="saveUserInfo">保存</view> <!-- <view class="save-btn" bindtap="saveUserInfo">保存</view> -->
<Footer />

View File

@ -1,11 +1,13 @@
.container { .container {
padding: 32rpx; padding: 32rpx;
background-color: #f1f5fe;
height: 100vh;
} }
.user-info { .user-info {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 48rpx; margin-bottom: 60rpx;
} }
.avatar-box { .avatar-box {
@ -47,7 +49,7 @@
.label { .label {
color: #666; color: #666;
font-size: 28rpx; font-size: 28rpx;
width: 160rpx; width: 120rpx;
} }
picker { picker {
@ -66,15 +68,12 @@ picker {
margin: 0 auto; margin: 0 auto;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
position: fixed; margin-top: 40rpx;
left: 0;
right: 0;
bottom: 32rpx;
} }
.name { .name {
@ -104,7 +103,7 @@ picker {
.stat-value { .stat-value {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #ff512a; color: #2583FF;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
@ -112,3 +111,23 @@ picker {
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
} }
.btn {
width: 95%;
margin: 0 auto;
margin-bottom: 20rpx;
background-color: #fff;
display: flex;
align-items: center;
height: 90rpx;
border-radius: 16rpx;
padding-left: 40rpx;
font-weight: 400;
font-size: 28rpx;
color: #222222;
}
.editMaster{
border: 1rpx solid #999;
padding: 10rpx 20rpx;
border-radius: 10rpx;
}

View File

@ -0,0 +1,133 @@
let util = require('../../../utils/util')
let apiArr = require('../../../api/water_filter')
// packages/master/device/index.js
Page({
/**
* 页面的初始数据
*/
data: {
deviceList: [],
page_num: 1,
page_size: 10,
flag: false,
option1: [
{ text: '全部', value: 0 },
{ text: '在用', value: 1 },
{ text: '已拆机', value: 2 },
{ text: '已报废 ', value: 3 },
{ text: '已在库', value: 4 },
],
active: 0,
},
desc(e){
console.log(e);
wx.navigateTo({
url: '/packages/master/deviceInfo/index?id=' + e.currentTarget.dataset.id,
})
},
changeActive(e){
let that = this
that.setData({
active:e.currentTarget.dataset.item.value,
page_num: 1,
deviceList:[]
})
that.getDeviceList()
},
getDeviceList() {
let that = this
wx.showLoading({
title: '加载中...',
})
util.postUrl(apiArr.masterDeviceList, {
page_num: that.data.page_num,
page_size: that.data.page_size,
info_id: wx.getStorageSync('info_id'),
status:that.data.active
}, res => {
let flag = false
wx.hideLoading()
if (res.rows) {
if (res.rows.length == that.data.page_size) {
flag = true
} else {
flag = false
}
that.setData({
page_num: that.data.page_num + 1,
flag,
deviceList: that.data.deviceList.concat(res.rows || [])
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this
that.getDeviceList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
let that = this
if (that.data.flag) {
that.getDeviceList()
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,45 @@
<view class="device-list-container">
<view class="navBox">
<view class="{{active == item.value?'navItem active':'navItem'}}" data-item="{{item}}" bind:tap="changeActive" wx:for="{{option1}}">{{item.text}}</view>
</view>
<view class="device-item" wx:for="{{deviceList}}" wx:key="device_id" data-id="{{item.device_id}}" bind:tap="desc">
<view class="device-info">
<view class="device-field">
<label class="field-label">设备名称:</label>
<text class="field-value">{{item.product_name}}</text>
</view>
<view class="device-field">
<label class="field-label">安装师傅:</label>
<text class="field-value">{{item.customer_name}}</text>
</view>
<view class="device-field">
<label class="field-label">师傅电话:</label>
<text class="field-value">{{item.customer_phone}}</text>
</view>
<view class="device-field">
<label class="field-label">地址:</label>
<text class="field-value">{{item.region}} {{item.address}}</text>
</view>
<view class="device-field">
<label class="field-label">经销商:</label>
<text class="field-value">{{item.dealer.deal_name}}</text>
</view>
<view class="device-field">
<label class="field-label">设备状态:</label>
<text class="field-value" wx:if="{{item.status == 1}}">在用</text>
<text class="field-value" wx:if="{{item.status == 2}}">已拆机</text>
<text class="field-value" wx:if="{{item.status == 3}}">已报废</text>
<text class="field-value" wx:if="{{item.status == 4}}">已在库</text>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,61 @@
.device-list-container {
padding: 10px;
}
.device-item {
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
border-bottom: 4rpx solid #f1f5fe;
}
.device-field {
margin-bottom: 8px;
}
.field-label {
font-weight: bold;
display: inline-block;
width: 80px;
}
.field-value {
display: inline-block;
}
.navBox {
display: flex;
align-items: center;
padding: 0 20rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
}
.navItem {
flex: 1;
white-space: nowrap;
font-weight: 400;
font-size: 28rpx;
color: #555555;
text-align: center;
}
.active {
font-weight: bold;
position: relative;
font-size: 32rpx;
}
.active::after {
content: '';
width: 90%;
height: 10rpx;
background: #2583FF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
position: absolute;
left: 50%;
bottom: -8rpx;
transform: translateX(-50%);
}

View File

@ -0,0 +1,416 @@
let util = require('../../../utils/util')
let apiArr = require('../../../api/water_filter')
import * as echarts from '../../../component/ec-canvas/echarts';
// packages/master/deviceInfo/index.js
Page({
/**
* 页面的初始数据
*/
data: {
id: "",
currentDevice: "",
imagePath: "",
ec: {
onInit: initChart
},
appointment_time:"",
show:false,
minDate: new Date().getTime(),
formatter(type, value) {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
},
},
onInput(event) {
let that = this
const date = new Date(event.detail); // 获取选中的 Date 对象
const year = date.getFullYear(); // 获取年份
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始所以需要+1
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
that.setData({
appointment_time:time,
show: false
})
that.cancelActivation()
},
onClose(){
let that =this
that.setData({
show:false
})
},
getInfo() {
let that = this
console.log(that, 'ssss');
util.postUrl(apiArr.masterDeviceInfo, {
device_id: that.data.id
}, res => {
res.product_icon = util.img_url + res.product_icon
res.difDay = that.getDaysBetweenDates(res.install_time) //服务天数
res.remainDay = that.getDaysBetweenDates2(res.expiration_duration) //剩余天数
if (res.parts) {
res.parts.forEach(item => {
item.difDay = that.getDaysBetweenDates(item.start_time)
item.percentageDay = Math.round(
((item.available_days - item.difDay) / item.available_days) * 100
);
item.percentageCapacity = (item.threshold_volume / item.available_volume ) * 100 //容量百分比
})
}
that.setData({
currentDevice: res
})
let Xarr = [];
let Yarr = [];
res.device_net.forEach(item => {
Xarr.push(item.create_time.slice(11, 16))
Yarr.push((item.cumulative_filtration_flow).toFixed(1))
})
that.updateChart({
xAxis: Xarr,
series: Yarr
})
that.getDeriveInfo()
setTimeout(() => {
const ecComponent = that.selectComponent("#mychart-dom-bar")
// 将 canvas 内容转换为临时图片文件
ecComponent.canvasToTempFilePath({
// canvasId: 'mychart-dom-bar',
success: (result) => {
that.base64({
url: result.tempFilePath,
type: 'png',
}).then((res) => {
that.setData({
imagePath: res
})
})
},
fail: (err) => {
console.error('转换失败:', err);
}
});
}, 2000)
})
},
replay(e){
wx.showLoading({
title: '重置中...',
})
util.postUrl(apiArr.resetFilter,{
part_id:e.currentTarget.dataset.item.parts_id,
device_id:e.currentTarget.dataset.item.device_id,
},res=>{
wx.hideLoading()
console.log(res);
if(res.msg == '操作成功'){
wx.showToast({
title: '重置成功!',
icon:"none"
})
that.getfilterList()
}else{
wx.showToast({
title: res.msg,
icon:"none"
})
}
})
},
//拆机
deleteDevice(){
let that = this
wx.showModal({
title: '提示',
content: '请确保设备通电开机状态,该操作将取消设备激活状态',
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
that.setData({
show:true
})
}
}
})
},
cancelActivation(){
let that = this
util.postUrl(apiArr.cancelActivation,{
device_id:that.data.currentDevice.device_id
},res=>{
that.createUninstall()
})
},
createUninstall(){
let that= this
util.postUrl(apiArr.createUninstallOrder,{
device_id:that.data.currentDevice.device_id,
info_id:wx.getStorageSync('info_id'),
appointment_time:that.data.appointment_time,
remark: ''
},res=>{
console.log(res);
})
},
//查询设备实时信息
getDeriveInfo() {
let that = this
util.postUrl(apiArr.boardInfo, {
device_id: that.data.currentDevice.device_id
}, res => {
console.log(res);
})
},
//开关机
openOff() {
let that = this
let onOff = ''
if(that.data.currentDevice.sevice_status == 1){
onOff = 2
}else if(that.data.currentDevice.sevice_status == 2){
onOff = 1
}
util.postUrl(apiArr.openOff, {
deviceId: that.data.currentDevice.device_id,
onOff
}, res => {
if (res.msg == '操作成功') {
if (res.data.params.sevice_status.value == '00') {
wx.showToast({
title: '关机成功!',
icon: "none"
})
that.setData({
"currentDevice.sevice_status": 0
})
} else if (res.data.params.sevice_status.value == '10') {
wx.showToast({
title: '开机成功!',
icon: "none"
})
that.setData({
"currentDevice.sevice_status": 1
})
console.log('开机');
}
}
})
},
updateChart(data) {
const ecComponent = this.selectComponent("#mychart-dom-bar");
if (!ecComponent) return;
this.setData({
chartData: data
});
ecComponent.init((canvas, width, height, dpr) => {
const chart = initChart(canvas, width, height, dpr);
chart.setOption({
grid: {
left: '3%', // 左边距
right: '4%', // 右边距
bottom: '3%', // 底部边距
containLabel: true // 确保标签包含在内
},
xAxis: {
data: data.xAxis
},
series: [{
data: data.series,
label: { // 添加这个label配置
show: true, // 开启显示
position: 'top', // 位置在柱子上方
color: '#333', // 文字颜色
// fontSize: 8 // 文字大小
}
}]
});
return chart;
});
},
base64({ url, type }) {
return new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: url, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success: res => {
resolve('data:image/' + type.toLocaleLowerCase() + ';base64,' + res.data)
},
fail: res => reject(res.errMsg)
})
})
},
convertCanvasToImage() {
wx.canvasToTempFilePath({
canvasId: 'myChart',
success: (res) => {
console.log(res.tempFilePath);
this.setData({
imagePath: res.tempFilePath
});
},
fail: (err) => {
console.error('Canvas to image failed:', err);
}
});
},
getDaysBetweenDates(inputDate) {
const currentDate = new Date();
// 将传入的日期字符串转换为日期对象
const targetDate = new Date(inputDate);
// 计算两个日期之间的时间差(以毫秒为单位)
const timeDifference = currentDate - targetDate;
// 将时间差转换为天数
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
// 返回天数
return daysDifference;
},
getDaysBetweenDates2(targetDate) {
// 获取当前日期(不含时间)
const today = new Date();
today.setHours(0, 0, 0, 0); // 时间归零,避免时间差影响
// 解析目标日期格式YYYY-MM-DD
const target = new Date(targetDate);
target.setHours(0, 0, 0, 0);
// 计算毫秒差并转换为天数
const timeDiff = target - today;
const daysRemaining = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
return daysRemaining;
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this
that.setData({
id: options.id
})
that.getInfo()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let that = this
setTimeout(() => {
this.convertCanvasToImage()
}, 5000)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
function initChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // 将此选项设置为 2可以在高分辨率屏幕上绘制更清晰的图表
});
canvas.setChart(chart);
const option = {
xAxis: {
type: 'category',
// data: ['16:41', '22:41', '04:41', '10:41', '16:41'],
data: []
},
yAxis: {
type: 'value',
// data: ['0ml', '560ml']
min: 0,
axisLabel: {
formatter: '{value}ml'
}
},
series: [{
// data: [150, 230, 224, 218, 135, 147, 345],
data: [],
type: 'bar',
barWidth: 15,
itemStyle: { //柱状颜色和圆角
color: {
x: 0,
y: 1,
colorStops: [{
offset: 0,
color: '#FFBBAC',
}, {
offset: 1,
color: '#338BFF'
}]
},
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)
},
}]
};
chart.setOption(option);
return chart;
}

View File

@ -0,0 +1,5 @@
{
"usingComponents": {
"ec-canvas": "/component/ec-canvas/ec-canvas"
}
}

View File

@ -0,0 +1,168 @@
<!--pages/water_filter/water_filter.wxml-->
<!-- 人人爱净水页面 -->
<view class="water-filter">
<view class="top" style="background-image: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_401.png?v1'); background-size: 100% 100%; height: 698rpx; width: 100%;">
<!-- 位置定位 -->
<view class="positioning">
<view class="positioning-left">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group 38.png" mode="" class="positioning-icon-left" />
<text class="positioning-text">{{currentDevice.region + currentDevice.address}}</text>
</view>
</view>
<!-- 净化前后数值 -->
<view class="purification-value">
<view class="purification-value-left">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
<view class="purification-value-text">
<text class="front puri-text">净化前</text>
<text class="tds puri-text">水质TDS值</text>
<text class="tds-value puri-text">{{currentDevice.raw_water_value}}</text>
<text class="ppm puri-text">PPM</text>
</view>
</view>
<view class="purification-value-left purification-value-right">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
<view class="purification-value-text">
<text class="front puri-text">净化后</text>
<text class="tds puri-text">水质TDS值</text>
<text class="tds-value puri-text">{{currentDevice.purification_water_value}}</text>
<text class="ppm puri-text">PPM</text>
</view>
</view>
</view>
<!-- 净化前后水质 -->
<view class="water-quality">
<view class="water-quality-left">
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value < 20 }}">净化前水质:极好</text>
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 20 && currentDevice.raw_water_value < 50 }}">净化前水质:良好</text>
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 50 && currentDevice.raw_water_value < 150 }}">净化前水质:正常</text>
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 150 && currentDevice.raw_water_value < 300 }}">净化前水质:较差</text>
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 300 }}">净化前水质:极差</text>
</view>
<view class="water-quality-right water-quality-left" style="margin-left: 60rpx;">
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value < 20 }}">净化后水质:极好</text>
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 20 && currentDevice.purification_water_value < 50 }}">净化后水质:良好</text>
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 50 && currentDevice.purification_water_value < 150 }}">净化后水质:正常</text>
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 150 && currentDevice.purification_water_value < 300 }}">净化后水质:较差</text>
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 300 }}">净化后水质:极差</text>
</view>
</view>
</view>
<view>
<!-- 我的设备信息 -->
<view class="my-device">
<!-- <text class="mydevice text-color">我的设备</text> -->
<view class="device-info">
<text class="mydevice text-color">我的设备</text>
<view class="info-top">
<view class="device-name">{{currentDevice.product_name}}</view>
<view class="device-state">
<block wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 6}}">
<image wx:if="{{currentDevice.sevice_status != 1}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_405.png?v1" mode="" class="switch-icon" />
<image wx:if="{{currentDevice.sevice_status == 1}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/openBtn.png" mode="" class="switch-icon" />
<text class="switch-text text-color text-size" bind:tap="openOff">{{currentDevice.sevice_status == '1'?'开机':'关机'}}</text>
</block>
<image wx:if="{{currentDevice.network_status != '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon3.png" mode="" class="wifi-icon" />
<image wx:if="{{currentDevice.network_status == '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon4.png" mode="" class="wifi-icon" />
<text class="wifi-text text-color text-size">{{currentDevice.network_status == '1'?'在线':'离线'}}</text>
</view>
</view>
<view class="info-bottom">
<view class="device-id text-size">
编号:{{currentDevice.device_code}}
</view>
<view class="service-day text-size text-color">
已服务<span class="day-num">{{currentDevice.difDay}}</span><span class="day text-size">天</span>
</view>
<view class="service-day text-size text-color">
剩余天数
<span class="day-num2">{{ currentDevice.remainDay}}</span>
<!-- <span class="day-num2">{{currentDevice.RemainDay}}</span> -->
<span class="day text-size">天</span>
</view>
</view>
</view>
<van-divider />
</view>
<!-- 滤芯寿命 -->
<view class="lifetime">
<view class="lifetime-title">滤芯寿命</view>
<view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view>
<view>
<view wx:for="{{currentDevice.parts}}" wx:key="index">
<view class="progress-name">{{item.parts_name}}</view>
<view class="lifetime-progress">
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 1}}">
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
<text class="progress">{{item.percentageDay}}%</text>
</view>
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 2}}">
<van-progress style="width: 100%;" percentage="{{item.percentageCapacity}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
<text class="progress">{{item.percentageCapacity}}%</text>
</view>
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 3}}">
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
<text class="progress">{{item.percentageDay}}%</text>
</view>
<view class="replayBtn" bind:tap="replay" data-item="{{item}}" wx:if="{{currentDevice.billing_method != 3}}">
重置
</view>
</view>
</view>
</view>
</view>
<!-- 用水量 -->
<view class="water-consumption">
<view class="water-consumption-title">用水量</view>
<!-- 用水量统计 -->
<view class="water-consumption-row">
<view class="water-consumption-col">
<view class="water-consumption-col-name">累计用水量</view>
<view class="water-consumption-col-num">{{currentDevice.cumulative_filtration_flow}}<span class="water-consumption-col-num-size">L</span></view>
</view>
<view class="water-consumption-col col2">
<view class="water-consumption-col-name">今日用水量</view>
<view class="water-consumption-col-num">{{currentDevice.today}}<span class="water-consumption-col-num-size">L</span></view>
</view>
<view class="water-consumption-col col3">
<view class="water-consumption-col-name">昨日用水量</view>
<view class="water-consumption-col-num">{{currentDevice.yesterday}}<span class="water-consumption-col-num-size">L</span></view>
</view>
</view>
<!-- 用水量柱状图 -->
<view class="container">
<ec-canvas id="mychart-dom-bar" canvasId="mychart-dom-bar" type="2d" ec="{{ ec }}" ec="{{ ec }}"></ec-canvas>
<image src="{{imagePath}}" style="width: 100%;height:600rpx;"></image>
</view>
</view>
</view>
</view>
<view class="deleteBtn" bind:tap="deleteDevice" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
拆机
</view>
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom">
<van-datetime-picker bind:cancel="onClose" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
</van-popup>

View File

@ -0,0 +1,644 @@
.nav-box {
box-sizing: border-box;
width: 100%;
position: relative;
/* position: fixed; */
z-index: 2;
}
.nav-box .nav-bar {
display: flex;
align-items: center;
}
.nav-box .nav-bar .nav-bar-left,
.nav-box .nav-bar .nav-bar-right {
padding: 0 20rpx;
min-width: 36rpx;
}
.nav-box .nav-bar .nav-bar-left van-icon {
vertical-align: sub;
color: #333333;
}
.nav-box .nav-bar .nav-bar-title {
flex: 1;
text-align: center;
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
}
.nav-box .nav-bar-title {
color: red;
margin-left: -20rpx;
}
.water-filter {
width: 100vw;
overflow: hidden;
}
.nowrap {
white-space: nowrap;
}
.top {
background-color: #FFFFFF;
}
/* 位置定位 */
.positioning {
display: flex;
margin-left: 24rpx;
padding-top: 40rpx;
margin-right: 20rpx;
margin-bottom: 64rpx;
justify-content: space-between;
}
.positioning-left {
display: flex;
align-items: center;
overflow: hidden;
}
.positioning-right {
display: flex;
align-items: center;
}
.positioning-icon-left {
width: 33rpx;
height: 33rpx;
}
.positioning-text {
font-size: 26rpx;
color: #FFFFFF;
margin-left: 9rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.positioning-icon-right {
width: 24rpx;
height: 24rpx;
}
/* 净化前后数值 */
.purification-value {
display: flex;
margin-left: 114rpx;
}
.purification-value-left {
display: inline;
width: 210rpx;
height: 250rpx;
}
.purification-value-right {
margin-left: 116rpx;
}
.purification-value-icon {
width: 210rpx;
height: 250rpx;
position: absolute;
}
.purification-value-text {
position: absolute;
margin: 60rpx 42rpx 0 41rpx;
}
.puri-text {
display: flex;
justify-content: center;
color: #FFFFFF;
font-size: 26rpx;
}
.tds {
opacity: 0.5;
}
.tds-value {
font-size: 50rpx;
}
/* 净化前后水质 */
.water-quality {
margin-left: 80rpx;
margin-top: 23rpx;
}
.water-quality2 {
display: flex;
margin: 0 80rpx;
margin-top: 10rpx;
}
.water-quality2 .water-quality-left {
flex: 1;
display: flex;
text-align: center;
height: auto;
background: transparent;
}
.water-quality2 .water-quality-text {
width: 150rpx;
height: 50rpx;
background: #fff;
border-radius: 100rpx 100rpx 100rpx 100rpx;
color: #2583FF;
display: block;
line-height: 50rpx;
}
.water-quality-left {
display: inline;
width: 265rpx;
height: 50rpx;
padding: 10rpx 38rpx 10rpx 30rpx;
justify-content: center;
align-items: center;
border-radius: 20rpx;
background: linear-gradient(to right, #2583FF1a, #2583FF);
}
.water-quality-text {
font-size: 26rpx;
color: #FFFFFF;
}
/* 我的设备 */
.my-device {
background-color: #FFFFFF;
/* margin: 0 24rpx 0 20rpx; */
/* padding-bottom: 30rpx; */
}
.mydevice {
font-size: 28rpx;
display: flex;
margin-bottom: 23rpx;
}
.text-color {
color: #999999;
}
.replayBtn {
width: 120rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #2887ff;
color: #fff;
border-radius: 30rpx;
margin-left: 20rpx;
}
.day-num2 {
color: #ff0000da;
font-size: 36rpx;
font-weight: bold;
margin: 0 7rpx 0 8rpx;
}
.device-info {
margin: 0 24rpx 0 20rpx;
}
.info-top {
display: flex;
justify-content: space-between;
}
.device-name {
font-size: 36rpx;
color: #222222;
font-weight: bold;
}
.device-state {
display: flex;
align-items: center;
}
.switch-icon {
width: 28rpx;
height: 28rpx;
}
.switch-text {
margin-right: 31rpx;
margin-left: 10rpx;
}
.wifi-text {
margin-left: 10rpx;
}
.text-size {
font-size: 26rpx;
}
.wifi-icon {
width: 30rpx;
height: 22rpx;
}
.info-bottom {
display: flex;
margin-top: 22rpx;
justify-content: space-between;
align-items: center;
}
.device-id {
color: #2583FF;
/* display: inline; */
}
.service-day {
/* display: inline; */
/* float: right; */
}
.day-num {
color: #2583FF;
font-size: 36rpx;
font-weight: bold;
margin: 0 7rpx 0 8rpx;
}
.day {
color: #222222;
}
/* 购买滤芯和报修记录 */
.van-row {
padding: 0 20rpx !important;
}
.van-col {
display: flex;
background-color: #FFF0ED;
height: 150rpx;
border-radius: 30rpx;
align-items: center;
font-size: 28rpx;
font-weight: bold;
}
.purchase {
width: 100rpx;
height: 100rpx;
margin-left: 68rpx;
}
/* 功能列表 */
.van-grid {
margin-top: 20rpx;
background-color: #FFFFFF;
}
.van-icon__image {
width: 100rpx !important;
height: 100rpx !important;
}
.van-icon--image {
width: 100rpx !important;
height: 100rpx !important;
}
.van-grid-item__text {
font-size: 26rpx !important;
color: #222222 !important;
}
/* 滤芯寿命 */
.lifetime {
margin-top: 20rpx;
background-color: #FFFFFF;
padding: 30rpx 20rpx;
}
.lifetime-title {
font-size: 28rpx;
font-weight: bold;
color: #000000;
}
.lifetime-prompt {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
margin-bottom: 25rpx;
}
.lifetime-progress {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.progress-name {
white-space: nowrap;
/* width: 24%; */
overflow: hidden;
white-space: nowrap;
font-size: 26rpx;
}
.van-progress {
width: 100%;
margin-right: 19rpx;
margin-top: 10rpx;
}
.progress {
color: #000000;
font-size: 24rpx;
}
.contral3 {
display: flex;
flex-direction: column;
}
.equi-contral-right2 {
margin-top: 20rpx;
}
/* 用水量 */
.water-consumption {
background-color: #FFFFFF;
margin-top: 20rpx;
padding: 30rpx 24rpx 0 20rpx;
}
.water-consumption-title {
font-size: 28rpx;
font-weight: bold;
margin-bottom: 30rpx;
}
.row-index--van-row {
margin: 0 !important;
}
.van-col--8 {
display: inline;
height: 130rpx !important;
width: 220rpx !important;
margin-right: 5rpx;
}
.water-consumption-col-name {
font-size: 24rpx;
font-weight: normal;
color: #000000;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin-top: 12rpx;
margin-bottom: 16rpx;
}
.water-consumption-col-num {
text-align: center;
font-size: 38rpx;
font-weight: bold;
color: #2583FF;
}
.water-consumption-col-num-size {
font-size: 24rpx;
font-weight: normal;
}
.container {
width: 100%;
height: 600rpx;
padding-bottom: 100rpx;
position: relative;
}
.container canvas {
position: absolute;
right: -100vw;
top: 0;
}
#mychart-bar {
border-radius: 30rpx 30rpx 0 0;
}
.chart {
display: flex;
align-items: flex-end;
height: 300px;
}
.bar {
width: 20px;
margin: 0 5px;
background-color: blue;
border-radius: 30rpx 30rpx 0 0;
}
.water-consumption-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0;
margin: 0 24rpx;
}
.water-consumption-col {
width: 220rpx;
height: 112rpx;
background: linear-gradient(180deg, #F0F4FF 0%, #DEE7FF 100%);
border-radius: 20rpx 20rpx 20rpx 20rpx;
box-sizing: border-box;
}
.water-consumption-row .col2 {
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
margin: 0 20rpx;
}
.water-consumption-row .col3 {
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
}
.water-consumption-col .water-consumption-col-name {
font-weight: 400;
font-size: 24rpx;
color: #000000;
}
.water-consumption-col .water-consumption-col-num {
font-weight: bold;
font-size: 36rpx;
color: #2583FF;
}
.equi-contral {
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 20rpx;
margin-right: 20rpx;
}
.equi-contral2 .equi-contral-right {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.equi-contral2 .equi-contral-right .equi-contral-right-btn2 {
margin-top: 0;
width: 335rpx;
}
.equi-contral2 .equi-contral-right .equi-contral-right-btn1 {
margin-top: 0;
width: 335rpx;
}
.equi-contral-left {
position: relative;
width: 345rpx;
height: 320rpx;
background: #FFF0ED;
border-radius: 30rpx 30rpx 30rpx 30rpx;
font-weight: bold;
font-size: 28rpx;
color: #000000;
box-sizing: border-box;
padding-top: 58rpx;
padding-left: 28rpx;
}
.equi-contral-left #img1 {
width: 219.21rpx;
height: 175rpx;
position: absolute;
left: 116rpx;
bottom: 5rpx;
}
.equi-contral-left #img2 {
width: 119rpx;
height: 95rpx;
position: absolute;
bottom: 32rpx;
left: 180rpx;
}
.van-grid-item__text text {
white-space: nowrap;
}
.equi-contral-right {
/* justify-content: center !important; */
}
.equi-contral-right-btn1 {
width: 345rpx;
height: 150rpx;
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
border-radius: 20rpx 20rpx 20rpx 20rpx;
font-weight: bold;
font-size: 28rpx;
color: #000000;
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 30rpx;
padding-right: 30rpx;
box-sizing: border-box;
}
.equi-contral-right-btn1 image {
width: 100rpx;
height: 100rpx;
}
.equi-contral-right-btn2 {
width: 345rpx;
height: 150rpx;
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 23rpx;
position: relative;
box-sizing: border-box;
font-weight: bold;
font-size: 28rpx;
color: #000000;
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 30rpx;
padding-right: 30rpx;
box-sizing: border-box;
}
.equi-contral-right-btn2 image {
width: 100rpx;
height: 100rpx;
}
.foot-fixed {
z-index: 999999999999 !important;
}
.btnDevice {
width: 650rpx;
height: 80rpx;
background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 300rpx;
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
}
.deleteBtn{
width: 100rpx;
height: 100rpx;
background-color: #dd0000;
color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}

View File

@ -0,0 +1,162 @@
let util = require('../../../utils/util')
let apiArr = require('../../../api/water_filter')
// packages/master/masterInfo/index.js
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {},
sexOptions: ['男', '女'],
sexIndex: "",
avatarUrl:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/person/Group_309.png?2",
avatarUrl2:"",
fileList:[],
},
// 选择头像
chooseAvatar() {
let that = this
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: (res) => {
const tempFilePath = res.tempFiles[0].tempFilePath;
// 这里可以添加上传头像到服务器的逻辑
util.uploadFileUrl(tempFilePath, (res) => {
let datas = JSON.parse(res)
console.log(datas.data);
let url = util.img_url + datas.data.path
let url2 = datas.data.path
let fileList = that.data.fileList
let obj = {
url: url,
name: 'avatar'
}
fileList.push(obj)
that.setData({
fileList,
avatarUrl: url,
avatarUrl2:url2
})
})
}
});
},
changeSex(e) {
const sexIndex = e.detail.value;
this.setData({
sexIndex,
'userInfo.sex': Number(sexIndex) + 1 // 更新性别值
});
// 这里可以添加保存性别到服务器的逻辑
},
getMasterInfo() {
let that = this
util.postUrl(apiArr.masterInfo, {
user_id: wx.getStorageSync('userId')
}, res => {
wx.setStorageSync('master', res)
that.setData({
userInfo: res,
sexIndex: res.sex - 1
})
if (res.avatar) {
that.setData({
avatarUrl: util.img_url + res.avatar
})
}
})
},
saveMasterInfo() {
let that = this
util.postUrl(apiArr.editMasterInfo,{
info_id:that.data.userInfo.info_id,
name:that.data.userInfo.name,
sex:that.data.userInfo.sex,
region:that.data.userInfo.region,
address:that.data.userInfo.address,
avatar:that.data.avatarUrl2,
phone:that.data.userInfo.phone
},res=>{
console.log(res);
if(res.msg == '操作成功'){
wx.showToast({
title: '修改成功!',
})
setTimeout(()=>{
wx.navigateBack({
delta:1
})
},1500)
}else{
wx.showToast({
title: res.msg,
icon:"none"
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
let that = this
that.getMasterInfo()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,32 @@
<view class="container">
<!-- 头像 -->
<view class="avatar-section">
<image class="avatar" src="{{avatarUrl}}" />
<button class="change-avatar-btn" bindtap="chooseAvatar">更换头像</button>
</view>
<!-- 师傅名称 -->
<view class="info-item">
<text class="label">师傅名称</text>
<input class="value" value="{{userInfo.name}}" bindinput="updateMasterName" placeholder="请输入师傅名称" />
</view>
<!-- 性别 -->
<view class="info-item">
<text class="label">性别</text>
<view style="flex: 1;display: flex;justify-content: flex-end;">
<picker mode="selector" range="{{sexOptions}}" value="{{sexIndex}}" bindchange="changeSex">
<view class="value">{{sexOptions[sexIndex]}}</view>
</picker>
</view>
</view>
<view class="info-item">
<text class="label">电话</text>
<input class="value" value="{{userInfo.phone}}" bindinput="updateMasterName" placeholder="请输入师傅电话" />
</view>
<!-- 保存按钮 -->
<view class="save-btn" bindtap="saveMasterInfo">保存</view>
</view>

View File

@ -0,0 +1,61 @@
.container {
padding: 32rpx;
}
.avatar-section {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40rpx;
}
.avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.change-avatar-btn {
font-size: 28rpx;
color: #2583ff;
background-color: transparent;
border: none;
}
.info-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 32rpx 0;
border-bottom: 1rpx solid #eee;
}
.label {
font-size: 28rpx;
color: #333;
}
.value {
font-size: 28rpx;
color: #666;
}
.save-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
background-color: #2583ff;
color: #fff;
font-size: 32rpx;
text-align: center;
border-radius: 40rpx;
margin-top: 40rpx;
}
input{
text-align: right;
}
.picker{
flex: 1;
}

View File

@ -9,31 +9,61 @@ Page({
t: app.menu.top, // 胶囊局顶部距离 t: app.menu.top, // 胶囊局顶部距离
h: app.menu.height, // 胶囊高度 h: app.menu.height, // 胶囊高度
option1: [ option1: [
{ text: '新装工单', value: 0 }, { text: '新装工单', value: 0 },
{ text: '维修工单', value: 1 }, { text: '维修工单', value: 1 },
{ text: '拆机工单', value: 3 },
{ text: '移机工单', value: 4 },
{ text: '滤芯更换工单', value: 2 }, { text: '滤芯更换工单', value: 2 },
], ],
active:0,
value1: 0, value1: 0,
page_num: 1, page_num: 1,
page_size: 10, page_size: 10,
flag: false, flag: false,
searchCon: "", searchCon: "",
NewOrderList: [], //新装工单
RepairOrderList: [],//维修工单
PartOrderList: [],//滤芯跟换工单
UninstallOrderList:[],//拆卸工单
RemoveList:[],//移机工单
info_id: "",//师傅id
},
changeActive(e){
let that = this
that.setData({
active:e.currentTarget.dataset.item.value,
page_num: 1,
NewOrderList: [], NewOrderList: [],
RepairOrderList: [], RepairOrderList: [],
PartOrderList: [], PartOrderList: [],
UninstallOrderList:[],
})
if (that.data.active == 0) {
that.getNewOrderList()
} else if (that.data.active == 1) {
that.gerRepairOrderList()
} else if(that.data.active == 2){
that.getPartOrderList()
}else if(that.data.active == 3){
this.getUninstallOrder()
}
info_id: "",//师傅id
}, },
// 查看工单详情 // 查看工单详情
viewOrderDetail(e) { viewOrderDetail(e) {
let that = this let that = this
console.log(123456);
const id = e.currentTarget.dataset.id; const id = e.currentTarget.dataset.id;
wx.navigateTo({ wx.navigateTo({
url: `/packages/master/orderDesc/index?id=${id}&type=${that.data.value1}` url: `/packages/master/orderDesc/index?id=${id}&type=${that.data.active}`
}); });
}, },
@ -66,6 +96,10 @@ Page({
onLoad() { onLoad() {
// 移除原有的wx.setNavigationBarRightButton相关代码 // 移除原有的wx.setNavigationBarRightButton相关代码
let that = this let that = this
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
onShow() { onShow() {
let that = this let that = this
@ -74,10 +108,12 @@ Page({
NewOrderList: [], NewOrderList: [],
RepairOrderList: [], RepairOrderList: [],
PartOrderList: [], PartOrderList: [],
UninstallOrderList:[],
page_num: 1 page_num: 1
}) })
console.log(that.data.value1,'value1');
that.getMasterInfo() that.getMasterInfo()
}, },
// 跳转到个人中心 // 跳转到个人中心
@ -93,6 +129,7 @@ Page({
let that = this let that = this
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
mask:true
}) })
util.postUrl(apiArr.getNewOrder, { util.postUrl(apiArr.getNewOrder, {
info_id: that.data.info_id, info_id: that.data.info_id,
@ -125,6 +162,8 @@ Page({
let that = this let that = this
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
mask:true
}) })
util.postUrl(apiArr.gerRepairOrder, { util.postUrl(apiArr.gerRepairOrder, {
info_id: that.data.info_id, info_id: that.data.info_id,
@ -156,6 +195,8 @@ Page({
let that = this let that = this
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
mask:true
}) })
util.postUrl(apiArr.getPartOrder, { util.postUrl(apiArr.getPartOrder, {
info_id: that.data.info_id, info_id: that.data.info_id,
@ -182,6 +223,40 @@ Page({
} }
}) })
}, },
//拆除工单
getUninstallOrder() {
let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.getUninstallOrder, {
info_id: that.data.info_id,
status: 0,
page_num: that.data.page_num,
page_size: that.data.page_size
}, res => {
wx.hideLoading()
if (res.msg == '操作成功') {
let flag = false
if (res.rows && res.rows.length == that.data.page_size) {
flag = true
} else {
flag = false
}
that.setData({
UninstallOrderList: that.data.UninstallOrderList.concat(res.rows || []),
page_num: that.data.page_num + 1,
flag
})
} else {
wx.showToast({
title: res.msg,
})
}
})
},
//师傅信息 //师傅信息
getMasterInfo() { getMasterInfo() {
let that = this let that = this
@ -191,57 +266,46 @@ Page({
that.setData({ that.setData({
info_id: res.info_id info_id: res.info_id
}) })
wx.setStorageSync('info_id', res.info_id)
that.searchIcon() that.searchIcon()
}) })
}, },
searchIcon() { searchIcon() {
let that = this let that = this
that.setData({ that.setData({
flag: false, flag: false,
NewOrderList: [], NewOrderList: [],
RepairOrderList: [], RepairOrderList: [],
PartOrderList: [], PartOrderList: [],
UninstallOrderList:[],
page_num: 1 page_num: 1
}) })
if (that.data.value1 == 0) { if (that.data.active == 0) {
that.getNewOrderList() that.getNewOrderList()
} else if (that.data.value1 == 1) { } else if (that.data.active == 1) {
that.gerRepairOrderList() that.gerRepairOrderList()
} else { } else if(that.data.active == 2){
that.getPartOrderList() that.getPartOrderList()
}else if(that.data.active == 3){
this.getUninstallOrder()
} }
}, },
iptChange(e) {
let that = this onShareAppMessage(){
that.setData({ return {
searchCon: e.detail.value title: '人人爱净水', // 分享卡片标题(必填)
}) path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
if (that.data.value1 == 0) { imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
that.getNewOrderList()
} else if (that.data.value1 == 1) {
that.gerRepairOrderList()
} else {
that.getPartOrderList()
} }
}, },
dropDownChange(e) { onShareTimeline() {
let that = this return {
let value1 = e.detail title: '人人爱净水', // 自定义标题
that.setData({ query: '', // 自定义页面路径中的参数
value1, imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
page_num: 1,
NewOrderList: [],
RepairOrderList: [],
PartOrderList: [],
})
if (that.data.value1 == 0) {
that.getNewOrderList()
} else if (that.data.value1 == 1) {
that.gerRepairOrderList()
} else {
that.getPartOrderList()
} }
}, },
}); });

View File

@ -1,4 +1,6 @@
{ {
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {
"Footer":"/component/masterFooter/index"
}
} }

View File

@ -1,13 +1,8 @@
<!-- 将van-dropdown-menu和search-bar包裹在一个view中 --> <!-- 将van-dropdown-menu和search-bar包裹在一个view中 -->
<view class="fixed-top"> <view class="fixed-top">
<van-dropdown-menu>
<van-dropdown-item bind:change="dropDownChange" value="{{ value1 }}" options="{{ option1 }}" />
</van-dropdown-menu>
<view class="navBox">
<view class="search-bar"> <view class="{{active == item.value?'navItem active':'navItem'}}" data-item="{{item}}" bind:tap="changeActive" wx:for="{{option1}}">{{item.text}}</view>
<input class="search-input" placeholder="搜索订单" value="{{searchCon}}" bindinput="iptChange" />
<image class="search_icon" bind:tap="searchIcon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/_assets/Group_36.png" mode="widthFix" />
</view> </view>
</view> </view>
@ -16,15 +11,11 @@
<view class="content"> <view class="content">
<!-- 新装工单 --> <!-- 新装工单 -->
<scroll-view class="order-list" scroll-y wx:if="{{value1 == 0}}"> <scroll-view class="order-list" scroll-y wx:if="{{active == 0}}">
<block wx:for="{{NewOrderList}}"> <block wx:for="{{NewOrderList}}">
<view class="order-item" wx:key="install_id" data-id="{{item.install_id}}" bind:tap="viewOrderDetail"> <view class="order-item" wx:key="install_id" data-id="{{item.install_id}}" bind:tap="viewOrderDetail">
<!-- 订单基本信息 --> <!-- 订单基本信息 -->
<view class="order-info"> <view class="order-info">
<view class="order-field">
<text class="label">设备名称:</text>
<text class="value">{{item.product_name}}</text>
</view>
<view class="order-field"> <view class="order-field">
<text class="label">提交人:</text> <text class="label">提交人:</text>
@ -39,6 +30,11 @@
<text class="value">{{item.appointment_time}}</text> <text class="value">{{item.appointment_time}}</text>
</view> </view>
<view class="order-field">
<text class="label">预约地址:</text>
<text class="value">{{item.region}} {{item.address}}</text>
</view>
<view class="order-field"> <view class="order-field">
<text class="label">客户备注:</text> <text class="label">客户备注:</text>
<text class="value">{{item.remark}}</text> <text class="value">{{item.remark}}</text>
@ -47,9 +43,10 @@
<view class="order-field"> <view class="order-field">
<text class="label">订单状态:</text> <text class="label">订单状态:</text>
<text class="value " wx:if="{{item.status == '1'}}">待分配</text> <text class="value " wx:if="{{item.status == '1'}}">待分配</text>
<text class="value " wx:if="{{item.status == '2'}}">待分配</text> <text class="value " wx:if="{{item.status == '2'}}">待安装</text>
<text class="value " wx:if="{{item.status == '3'}}">已安装</text> <text class="value " wx:if="{{item.status == '3'}}">已安装</text>
<text class="value " wx:if="{{item.status == '4'}}">已撤销</text> <text class="value " wx:if="{{item.status == '4'}}">已取消</text>
<text class="value " wx:if="{{item.status == '5'}}">待激活</text>
</view> </view>
</view> </view>
@ -58,7 +55,7 @@
</scroll-view> </scroll-view>
<!-- 维修工单 --> <!-- 维修工单 -->
<scroll-view class="order-list" scroll-y wx:if="{{value1 == 1}}"> <scroll-view class="order-list" scroll-y wx:if="{{active == 1}}">
<block wx:for="{{RepairOrderList}}"> <block wx:for="{{RepairOrderList}}">
<view class="order-item" wx:key="install_id" data-id="{{item.repair_id}}" bind:tap="viewOrderDetail"> <view class="order-item" wx:key="install_id" data-id="{{item.repair_id}}" bind:tap="viewOrderDetail">
<!-- 订单基本信息 --> <!-- 订单基本信息 -->
@ -104,21 +101,21 @@
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<!-- 滤材更换工单 --> <!-- 滤材更换工单 -->
<scroll-view class="order-list" scroll-y wx:if="{{value1 == 2}}"> <scroll-view class="order-list" scroll-y wx:if="{{active == 2}}">
<block wx:for="{{PartOrderList}}"> <block wx:for="{{PartOrderList}}">
<view class="order-item" wx:key="install_id" data-id="{{item.replace_id}}" bind:tap="viewOrderDetail"> <view class="order-item" wx:key="install_id" data-id="{{item.replace_id}}" bind:tap="viewOrderDetail">
<!-- 订单基本信息 --> <!-- 订单基本信息 -->
<view class="order-info"> <view class="order-info">
<view class="order-field"> <!-- <view class="order-field">
<text class="label">设备名称:</text> <text class="label">设备名称:</text>
<text class="value">{{item.product_name}}</text> <text class="value">{{item.device.product_name}}</text>
</view> </view>
<view class="order-field"> <view class="order-field">
<text class="label">配件名称:</text> <text class="label">配件名称:</text>
<text class="value">{{item.parts_name}}</text> <text class="value">{{item.parts_list[0].parts_name}}</text>
</view> </view> -->
<view class="order-field"> <view class="order-field">
<text class="label">提交人:</text> <text class="label">提交人:</text>
@ -148,8 +145,9 @@
<view class="order-field"> <view class="order-field">
<text class="label">订单状态:</text> <text class="label">订单状态:</text>
<text class="value " wx:if="{{item.status == '1'}}">待分配</text> <text class="value " wx:if="{{item.status == '1'}}">待分配</text>
<text class="value " wx:if="{{item.status == '2'}}">待分配</text> <text class="value " wx:if="{{item.status == '2'}}">待更换</text>
<text class="value " wx:if="{{item.status == '3'}}">已安装</text> <text class="value " wx:if="{{item.status == '3'}}">已更换</text>
<text class="value " wx:if="{{item.status == '4'}}">已撤销</text>
</view> </view>
</view> </view>
@ -159,12 +157,59 @@
</scroll-view> </scroll-view>
<scroll-view class="order-list" scroll-y wx:if="{{active == 3}}">
<block wx:for="{{UninstallOrderList}}">
<view class="order-item" wx:key="uninstall_id" data-id="{{item.uninstall_id}}" bind:tap="viewOrderDetail">
<!-- 订单基本信息 -->
<view class="order-info">
<view class="order-field">
<text class="label">设备名称:</text>
<text class="value">{{item.device.product_name}}</text>
</view>
<view class="order-field">
<text class="label">指派人:</text>
<text class="value">{{item.repairman_name}}</text>
</view>
<view class="order-field">
<text class="label" style="white-space: normal;">指派人电话:</text>
<text class="value">{{item.repairman_phone}}</text>
</view>
<view class="order-field">
<text class="label">提交人:</text>
<text class="value">{{item.customer_name}}</text>
</view>
<view class="order-field">
<text class="label">联系电话:</text>
<text class="value">{{item.customer_phone}}</text>
</view>
<!-- <view class="order-field">
<text class="label">预约地址:</text>
<text class="value">{{item.region}} {{item.address}}</text>
</view> -->
<view class="order-field">
<text class="label">预约时间:</text>
<text class="value">{{item.appointment_time}}</text>
</view>
<view class="order-field">
<text class="label">状态:</text>
<text class="value" wx:if="{{item.status == 2}}">已指派</text>
<text class="value" wx:if="{{item.status == 3}}">待操作 </text>
<text class="value" wx:if="{{item.status == 4}}">巳完成</text>
</view>
</view>
</view>
</block>
</scroll-view>
</view> </view>
<!-- 新增右下角按钮 --> <Footer />
<view class="fixed-bottom-right">
<view class="profile-btn" bindtap="navigateToProfile">
个人中心
</view>
</view>

View File

@ -36,14 +36,14 @@
.order-field { .order-field {
display: flex; display: flex;
align-items: center;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.label { .label {
color: #666; color: #666;
font-size: 28rpx; font-size: 28rpx;
width: 160rpx; width: 180rpx;
white-space: nowrap;
} }
.value { .value {
@ -68,7 +68,7 @@
} }
.complete-btn { .complete-btn {
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
} }
@ -111,7 +111,7 @@
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(255, 81, 42, 0.3); box-shadow: 0 4rpx 16rpx rgba(255, 81, 42, 0.3);
@ -130,11 +130,82 @@
/* 调整内容区域的上边距 */ /* 调整内容区域的上边距 */
.content { .content {
margin-top: 200rpx; margin-top: 80rpx;
/* 根据实际高度调整 */ /* 根据实际高度调整 */
} }
.search_icon { .search_icon {
width: 40rpx; width: 30rpx;
height: 40rpx; height: 30rpx;
}
.navBox {
display: flex;
align-items: center;
padding: 0 20rpx;
box-sizing: border-box;
}
.navItem {
flex: 1;
white-space: nowrap;
font-weight: 400;
font-size: 28rpx;
color: #555555;
}
.active {
font-weight: bold;
position: relative;
font-size: 32rpx;
}
.active::after {
content: '';
width: 90%;
height: 10rpx;
background: #2583FF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
position: absolute;
left: 50%;
bottom: -8rpx;
transform: translateX(-50%);
}
.btn1 {
width: 120rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx;
background-color: #2583ff;
color: #fff;
flex: unset;
}
.order-field2{
justify-content: flex-end;
}
.btn2{
width: 120rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx;
background-color: #2583ff;
color: #fff;
flex: unset;
}
.btn3{
width: 120rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx;
background-color: #2583ff;
color: #fff;
flex: unset;
} }

View File

@ -6,16 +6,42 @@ Page({
type: "", type: "",
id: "", id: "",
newOrderDesc: {}, newOrderDesc: {},
msg: "", newOrderDateShow:false,
newOrderDateAppointment:"",
msg: "", //安装说明
msg2: "", //更换说明
imgList: [], imgList: [],
imgList2: [], imgList2: [],
repairOrderDesc: {}, repairOrderDesc: {},
partOrderDesc: {}, partOrderDesc: {},
uninstallDesc: {},
uninstalldis: false,
uninstallMsg: "",
UninstallDate: false,
uninstall_time: "",
dis1: false, dis1: false,
dis2: false, dis2: false,
dis3: false, dis3: false,
deviceInfo: {}, deviceInfo: {},
deviceCode: "", deviceCode: "",
minDate: new Date().getTime(),
formatter(type, value) {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
},
}, },
// 新装/////////////////////////////// // 新装///////////////////////////////
//输入框 //输入框
@ -67,14 +93,12 @@ Page({
}, },
// 删除图片 // 删除图片
deleteImage(e) { deleteImage(e) {
console.log(e);
let that = this let that = this
const index = e.currentTarget.dataset.index; const index = e.currentTarget.dataset.index;
let imgList = that.data.imgList let imgList = that.data.imgList
let imgList2 = that.data.imgList2 let imgList2 = that.data.imgList2
imgList.splice(index, 1)
imgList = imgList.slice(index, 1) imgList2.splice(index, 1)
imgList2 = imgList2.slice(index, 1)
this.setData({ this.setData({
imgList, imgList,
imgList2 imgList2
@ -82,20 +106,54 @@ Page({
}, },
getNewOrderDesc() { getNewOrderDesc() {
let that = this let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.newOrderDesc, { install_id: Number(that.data.id) }, res => { util.postUrl(apiArr.newOrderDesc, { install_id: Number(that.data.id) }, res => {
wx.hideLoading()
console.log(res); console.log(res);
res.product_icon = util.img_url + res.product_icon res.product_icon2 = util.img_url + res.product_icon
let imgList = ''
let newArr = []
if (res.install_imgs) {
imgList = res.install_imgs.split(",")
newArr = []
imgList.forEach(item => {
newArr.push(util.img_url + item)
})
} else {
imgList = ''
newArr = []
}
that.setData({ that.setData({
newOrderDesc: res, newOrderDesc: res,
imgList: newArr,
msg:res.install_desc,
newOrderDateAppointment:res.remaining_days
}) })
if (res.status == 3 ) { if (res.status == 3 ) {
let imgList2 = res.install_imgs.split(',') that.getDeriveInfo()
let imgList2 = ''
let imgList = [] let imgList = []
if (res.install_imgs) {
console.log(123);
imgList2 = res.install_imgs.split(',')
imgList = []
imgList2.forEach((item, index) => { imgList2.forEach((item, index) => {
imgList.push(util.img_url + item) imgList.push(util.img_url + item)
}) })
} else {
console.log(456);
imgList2 = []
imgList = []
}
that.setData({ that.setData({
msg: res.install_desc, msg: res.install_desc,
imgList2, imgList2,
@ -104,17 +162,69 @@ Page({
}) })
} }
}) })
}, },
completeNewOrder(e) {
let status = Number(e.currentTarget.dataset.type) closeNewOrder(){
let that= this
that.setData({
newOrderDateShow:!that.data.newOrderDateShow
})
},
changeNewAppointment(e){
let that = this
that.setData({
newOrderDateAppointment:e.detail.value
})
},
jihuoItem() {
let that = this
util.postUrl(apiArr.BeActive, {
install_id: that.data.newOrderDesc.install_id,
remaining_days:Number(that.data.newOrderDateAppointment)
}, res => {
console.log(res);
if (res.msg == '操作成功') {
wx.showToast({
title: '激活成功!',
icon: "none"
})
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
}
})
},
completeNewOrder() {
let that = this let that = this
let content = '确认完成该工单吗?' let content = '确认完成该工单吗?'
if (status == 3) {
content = '确认完成该工单吗?' if (!that.data.msg) {
} else { return wx.showToast({
content = '确认撤销该工单吗?' title: '请填写安装说明',
icon: "none"
})
} }
if (!that.data.deviceInfo.device_id) {
return wx.showToast({
title: '请扫码设备二维码',
icon: "none"
})
}
if (!that.data.imgList.length) {
return wx.showToast({
title: '请上传安装图片',
icon: "none"
})
}
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: content, content: content,
@ -122,12 +232,39 @@ Page({
if (res.confirm) { if (res.confirm) {
util.postUrl(apiArr.completeNewOrder, { util.postUrl(apiArr.completeNewOrder, {
install_id: Number(that.data.id), install_id: Number(that.data.id),
status, status: 5,
install_desc: that.data.msg, install_desc: that.data.msg,
install_imgs: that.data.imgList2.join(','), install_imgs: that.data.imgList2.join(','),
install_time: util.getCurrentTime(), install_time: util.getCurrentTime(),
device_id: that.data.deviceInfo.device_id, device_id: that.data.deviceInfo.device_id,
product_id: that.data.deviceInfo.product_id product_id: that.data.deviceInfo.product_id
}, res => {
if (res.msg == '操作成功') {
// that.jihuoItem()
wx.showToast({
title: '创建成功!',
icon: "none"
})
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
} else {
wx.showToast({
title: res.msg,
icon: "none"
})
}
})
}
}
});
},
cancelNewOrder() {
let that = this
util.postUrl(apiArr.cancelNewOrder, {
install_id: Number(that.data.id),
}, res => { }, res => {
wx.showToast({ wx.showToast({
title: res.msg, title: res.msg,
@ -140,15 +277,11 @@ Page({
}, 1500); }, 1500);
} }
}) })
}
}
});
}, },
scanQrcode() { scanQrcode() {
let that = this let that = this
wx.scanCode({ wx.scanCode({
success: (res) => { success: (res) => {
console.log('扫码结果:', res.result);
// 处理扫码结果 // 处理扫码结果
this.setData({ this.setData({
deviceCode: res.result deviceCode: res.result
@ -157,6 +290,7 @@ Page({
util.postUrl(apiArr.getDeviceByCode, { util.postUrl(apiArr.getDeviceByCode, {
device_code: res.result device_code: res.result
}, res => { }, res => {
console.log(res, '222');
that.setData({ that.setData({
deviceInfo: res deviceInfo: res
}) })
@ -176,9 +310,14 @@ Page({
// 维修 /////////////////////////////// // 维修 ///////////////////////////////
getRepairOrderDesc() { getRepairOrderDesc() {
let that = this let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.RepairOrderDesc, { util.postUrl(apiArr.RepairOrderDesc, {
repair_id: that.data.id repair_id: that.data.id
}, res => { }, res => {
wx.hideLoading()
res.fault_imgs = util.img_url + res.fault_imgs res.fault_imgs = util.img_url + res.fault_imgs
that.setData({ that.setData({
repairOrderDesc: res repairOrderDesc: res
@ -241,16 +380,21 @@ Page({
// 滤芯更换 /////////////////////////////// // 滤芯更换 ///////////////////////////////
getPartOrderDesc() { getPartOrderDesc() {
let that = this let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.PartOrderDesc, { util.postUrl(apiArr.PartOrderDesc, {
replace_id: that.data.id replace_id: that.data.id
}, res => { }, res => {
wx.hideLoading()
that.setData({ that.setData({
partOrderDesc: res partOrderDesc: res
}) })
if (res.status == 3 || res.status == 4 ) { if (res.status == 3 || res.status == 4 ) {
that.setData({ that.setData({
msg: res.install_desc, msg2: res.install_desc,
dis3: true dis3: true
}) })
} }
@ -274,7 +418,7 @@ Page({
util.postUrl(apiArr.completePartOrder, { util.postUrl(apiArr.completePartOrder, {
replace_id: Number(that.data.id), replace_id: Number(that.data.id),
status, status,
install_desc: that.data.msg, install_desc: that.data.msg2,
install_time: util.getCurrentTime() install_time: util.getCurrentTime()
}, res => { }, res => {
wx.showToast({ wx.showToast({
@ -292,10 +436,198 @@ Page({
} }
}); });
}, },
updateInstructions2(e) {
let that = this
that.setData({
msg2: e.detail.value
})
},
// 滤芯更换 /////////////////////////////// // 滤芯更换 ///////////////////////////////
// 拆卸工单详情/////////////////////////////////////////////
getUninstallDesc() {
let that = this
wx.showLoading({
title: '加载中...',
mask:true
})
util.postUrl(apiArr.getUninstallDesc, {
uninstall_id: that.data.id
}, res => {
wx.hideLoading()
let uninstalldis = false
if(res.status != 2){
uninstalldis = true
}
let imgList = ''
let newArr = []
if (res.uninstall_imgs) {
imgList = res.uninstall_imgs.split(",")
imgList.forEach(item => {
newArr.push(util.img_url + item)
})
} else {
imgList = ''
newArr = []
}
that.setData({
uninstallDesc: res,
uninstall_time:res.uninstall_time,
uninstallMsg:res.uninstall_desc,
imgList:newArr,
uninstalldis
})
})
},
updateInstructions3(e) {
let that = this
that.setData({
uninstallMsg: e.detail.value
})
},
changeUninstallDate() {
let that = this
that.setData({
UninstallDate: !that.data.UninstallDate
})
},
onInput(event) {
let that = this
const date = new Date(event.detail); // 获取选中的 Date 对象
const year = date.getFullYear(); // 获取年份
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始所以需要+1
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
that.setData({
uninstall_time: time,
UninstallDate: false
})
},
onInput2(event) {
let that = this
const date = new Date(event.detail); // 获取选中的 Date 对象
const year = date.getFullYear(); // 获取年份
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始所以需要+1
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
that.setData({
newOrderDateAppointment: time,
newOrderDateShow: false
})
},
// 拆机
uninstallDesc() {
let that = this
if (!that.data.uninstallMsg) {
return wx.showToast({
title: '请填写拆除说明',
icon: "none"
})
}
if (!that.data.uninstall_time) {
return wx.showToast({
title: '请选择拆除时间',
icon: "none"
})
}
if (!that.data.imgList.length) {
return wx.showToast({
title: '请上传拆除图片',
icon: "none"
})
}
util.postUrl(apiArr.unintsall, {
uninstall_id: that.data.uninstallDesc.uninstall_id,
uninstall_time: that.data.uninstall_time + ':00',
uninstall_desc: that.data.uninstallMsg,
uninstall_imgs: that.data.imgList2.join(','),
}, res => {
console.log(res);
if (res.msg == '操作成功') {
wx.showToast({
title: '拆机成功!',
icon: "none"
})
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
} else {
wx.showToast({
title: res.msg,
icon: "none"
})
}
})
},
//报废 入库
operate(e) {
let that = this
let status = e.currentTarget.dataset.type
let content = ''
if (status == 9) {
content = '确定要入库吗'
} else {
content = '确定要报废吗'
}
wx.showModal({
title: '提示',
content: content,
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
util.postUrl(apiArr.operate, {
uninstall_id:that.data.uninstallDesc.uninstall_id,
status:status
},res=>{
wx.showToast({
title: '操作成功',
icon:"none"
})
setTimeout(()=>{
wx.navigateBack({
delta:1
})
},1500)
})
}
}
})
},
//查询设备实时信息
getDeriveInfo() {
let that = this
util.postUrl(apiArr.boardInfo, {
device_id: that.data.newOrderDesc.device_id
}, res => {
console.log(res);
})
},
onLoad(options) { onLoad(options) {
let that = this let that = this
// 这里可以根据options.id来设置不同的假数据 // 这里可以根据options.id来设置不同的假数据
@ -309,8 +641,31 @@ Page({
that.getNewOrderDesc() that.getNewOrderDesc()
} else if (options.type == 1) { } else if (options.type == 1) {
that.getRepairOrderDesc() that.getRepairOrderDesc()
} else { } else if (options.type == 2) {
that.getPartOrderDesc() that.getPartOrderDesc()
} else if (options.type == 3) {
that.getUninstallDesc()
}
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
onShareAppMessage() {
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
}
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
} }
}, },

View File

@ -29,17 +29,22 @@
<text class="value">{{newOrderDesc.address || '暂无数据'}}</text> <text class="value">{{newOrderDesc.address || '暂无数据'}}</text>
</view> </view>
<!-- <view class="info-item">
<text class="label">到期日期:</text>
<text class="value">{{newOrderDesc.expiration_duration || '暂无数据'}}</text>
</view> -->
<view class="info-item"> <view class="info-item">
<text class="label">订单状态:</text> <text class="label">订单状态:</text>
<text class="value " wx:if="{{newOrderDesc.status == '1'}}">待分配</text> <text class="value " wx:if="{{newOrderDesc.status == '1'}}">待分配</text>
<text class="value " wx:if="{{newOrderDesc.status == '2'}}">待分配</text> <text class="value " wx:if="{{newOrderDesc.status == '2'}}">待安装</text>
<text class="value " wx:if="{{newOrderDesc.status == '3'}}">已安装</text> <text class="value " wx:if="{{newOrderDesc.status == '3'}}">已安装</text>
</view> </view>
<view class="info-item"> <view class="info-item" wx:if="{{newOrderDesc.product_icon}}">
<text class="label">产品图片:</text> <text class="label">产品图片:</text>
</view> </view>
<view class="product-image"> <view class="product-image" wx:if="{{newOrderDesc.product_icon}}">
<image src="{{newOrderDesc.product_icon}}" mode="aspectFit" /> <image src="{{newOrderDesc.product_icon2}}" mode="aspectFit" />
</view> </view>
@ -50,7 +55,8 @@
<view class="section-title">安装说明</view> <view class="section-title">安装说明</view>
<view class="info-item"> <view class="info-item">
<text class="label">说明:</text> <text class="label">说明:</text>
<input class="value" value="{{msg}}" disabled="{{dis1}}" bindinput="updateInstructions" placeholder="请输入安装说明" /> <input class="value" value="{{msg}}" disabled="{{dis1}}" wx:if="{{newOrderDesc.status != 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
<input class="value" value="{{msg}}" disabled="{{true}}" wx:if="{{newOrderDesc.status == 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
</view> </view>
<view class="info-item" wx:if="{{dis1}}"> <view class="info-item" wx:if="{{dis1}}">
@ -59,17 +65,21 @@
</view> </view>
<view class="info-item item2"> <view class="info-item item2">
<text class="label">设备名称:</text> <text class="label">设备编码:</text>
<view class="value value2" wx:if="{{!deviceCode}}"> <view class="value value2" wx:if="{{!deviceCode}}">
<view class="btn" bind:tap="scanQrcode">去扫码</view> <view class="btn" bind:tap="scanQrcode" wx:if="{{newOrderDesc.status == '2'}}">去扫码</view>
</view> </view>
<view class="value value3" wx:if="{{deviceCode}}"> <view class="value value3" wx:if="{{deviceCode}}">
{{deviceInfo.product_name}} {{deviceInfo.device_code}}
<view class="btn" bind:tap="scanQrcode">重新扫码</view> <view class="btn" bind:tap="scanQrcode">重新扫码</view>
</view> </view>
</view> </view>
<view class="info-item" wx:if="{{newOrderDesc.status == 5}}">
<text class="label">剩余天数:</text>
<input class="value" type="number" bindinput="changeNewAppointment" placeholder="请输入剩余天数" value="{{newOrderDateAppointment}}" />
</view>
</view> </view>
<!-- 安装图片 --> <!-- 安装图片 -->
<view class="section"> <view class="section">
@ -78,10 +88,11 @@
<block wx:for="{{imgList}}" wx:key="index"> <block wx:for="{{imgList}}" wx:key="index">
<view class="image-container"> <view class="image-container">
<image class="installation-image" src="{{item}}" mode="aspectFill" /> <image class="installation-image" src="{{item}}" mode="aspectFill" />
<view wx:if="{{!dis1}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view> <view wx:if="{{!dis1 && newOrderDesc.status != 5}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view>
</view> </view>
</block> </block>
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!dis1}}">
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!dis1 && newOrderDesc.status == 2}}">
<text>+ 上传图片</text> <text>+ 上传图片</text>
</view> </view>
</view> </view>
@ -127,7 +138,8 @@
<text class="label">订单状态:</text> <text class="label">订单状态:</text>
<text class="value " wx:if="{{repairOrderDesc.status == '1'}}">待分配</text> <text class="value " wx:if="{{repairOrderDesc.status == '1'}}">待分配</text>
<text class="value " wx:if="{{repairOrderDesc.status == '2'}}">待分配</text> <text class="value " wx:if="{{repairOrderDesc.status == '2'}}">待分配</text>
<text class="value " wx:if="{{repairOrderDesc.status == '3'}}">已安装</text> <text class="value " wx:if="{{repairOrderDesc.status == '3'}}">已维修</text>
<text class="value " wx:if="{{repairOrderDesc.status == '4'}}">已撤销</text>
</view> </view>
<view class="info-item"> <view class="info-item">
@ -147,7 +159,7 @@
<view class="section-title">维修说明</view> <view class="section-title">维修说明</view>
<view class="info-item"> <view class="info-item">
<text class="label">说明:</text> <text class="label">说明:</text>
<input class="value" value="{{msg}}" disabled="{{dis2}}" bindinput="updateInstructions" placeholder="请输入安装说明" /> <input class="value" value="{{msg}}" disabled="{{dis2}}" bindinput="updateInstructions" placeholder="请输入维修说明" />
</view> </view>
<view class="info-item" wx:if="{{dis2}}"> <view class="info-item" wx:if="{{dis2}}">
@ -220,9 +232,17 @@
<text class="value">{{partOrderDesc.threshold_volume}}升</text> <text class="value">{{partOrderDesc.threshold_volume}}升</text>
</view> </view>
<view class="info-item">
<text class="label">订单状态:</text>
<text class="value " wx:if="{{partOrderDesc.status == '1'}}">待分配</text>
<text class="value " wx:if="{{partOrderDesc.status == '2'}}">待更换</text>
<text class="value " wx:if="{{partOrderDesc.status == '3'}}">已更换</text>
<text class="value " wx:if="{{partOrderDesc.status == '4'}}">已撤销</text>
</view>
</view> </view>
<view class="section">
<view class="section" wx:if="{{type == 1}}">
<view class="section-title">安装说明</view> <view class="section-title">安装说明</view>
<view class="info-item"> <view class="info-item">
<text class="label">说明:</text> <text class="label">说明:</text>
@ -234,13 +254,113 @@
</view> </view>
</view> </view>
<view class="section" wx:if="{{type == 2}}">
<view class="section-title">更换说明</view>
<view class="info-item">
<text class="label">说明:</text>
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
</view>
</view>
</block>
<block wx:if="{{type == 3}}">
<!-- 产品信息 -->
<view class="section">
<view class="section-title">工单信息</view>
<view class="info-item">
<text class="label">设备名称:</text>
<text class="value">{{uninstallDesc.device.product_name || '暂无数据'}}</text>
</view>
<view class="info-item">
<text class="label">指派人:</text>
<text class="value">{{uninstallDesc.repairman_name || '暂无数据'}}</text>
</view>
<view class="info-item">
<text class="label">联系电话:</text>
<text class="value">{{uninstallDesc.repairman_phone || '暂无数据'}}</text>
</view>
<view class="info-item">
<text class="label">提交人:</text>
<text class="value">{{uninstallDesc.customer_name}}</text>
</view>
<view class="info-item">
<text class="label">联系电话:</text>
<text class="value">{{uninstallDesc.customer_phone}}</text>
</view>
<view class="info-item">
<text class="label">预约时间:</text>
<text class="value">{{uninstallDesc.appointment_time}}</text>
</view>
<view class="info-item">
<text class="label">订单状态:</text>
<text class="value " wx:if="{{uninstallDesc.status == '2'}}">待拆机</text>
<text class="value " wx:if="{{uninstallDesc.status == '3'}}">待操作</text>
</view>
</view>
<view class="section" wx:if="{{type == 1}}">
<view class="section-title">安装说明</view>
<view class="info-item">
<text class="label">说明:</text>
<input class="value" disabled="{{dis3}}" value="{{msg}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
</view>
<view class="info-item" wx:if="{{dis3}}">
<text class="label">安装时间:</text>
<input class="value" value="{{partOrderDesc.install_time}}" disabled />
</view>
</view>
<view class="section" wx:if="{{type == 2}}">
<view class="section-title">更换说明</view>
<view class="info-item">
<text class="label">说明:</text>
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
</view>
</view>
<view class="section" wx:if="{{type == 3}}">
<view class="section-title">拆除说明</view>
<view class="info-item">
<text class="label">说明:</text>
<input class="value" disabled="{{uninstalldis}}" value="{{uninstallMsg}}" bindinput="updateInstructions3" placeholder="请输入拆除说明" />
</view>
<view class="info-item" >
<text class="label">拆除时间:</text>
<input class="value" wx:if="{{uninstallDesc.status == 2}}" bind:tap="changeUninstallDate" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
<input class="value" wx:if="{{uninstallDesc.status != 2}}" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
</view>
<view class="label">拆除图片</view>
<view class="installation-images" style="margin-top: 10rpx;">
<block wx:for="{{imgList}}" wx:key="index">
<view class="image-container">
<image class="installation-image" src="{{item}}" mode="aspectFill" />
<view wx:if="{{!uninstalldis}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view>
</view>
</block>
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!uninstalldis}}">
<text>+ 上传图片</text>
</view>
</view>
</view>
</block> </block>
<!-- 完成按钮 --> <!-- 完成按钮 -->
<view class="complete-btn-container" wx:if="{{type == 0 && !dis1 }}"> <view class="complete-btn-container" wx:if="{{type == 0 && !dis1 }}">
<button class="complete-btn cancel-btn" bindtap="completeNewOrder" data-type="4">撤销</button> <button class="complete-btn cancel-btn" bindtap="cancelNewOrder">撤销</button>
<button class="complete-btn" bindtap="completeNewOrder" data-type="3">完成</button> <button class="complete-btn" bindtap="completeNewOrder" wx:if="{{(newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">完成</button>
<button class="complete-btn " bindtap="jihuoItem" wx:if="{{newOrderDesc.status == 5}}">激活</button>
</view> </view>
<view class="complete-btn-container" wx:if="{{type == 1 && !dis2 }}"> <view class="complete-btn-container" wx:if="{{type == 1 && !dis2 }}">
@ -252,4 +372,31 @@
<button class="complete-btn cancel-btn" bindtap="completePartOrder" data-type="4">撤销</button> <button class="complete-btn cancel-btn" bindtap="completePartOrder" data-type="4">撤销</button>
<button class="complete-btn" bindtap="completePartOrder" data-type="3">完成</button> <button class="complete-btn" bindtap="completePartOrder" data-type="3">完成</button>
</view> </view>
<view class="complete-btn-container" wx:if="{{type == 3 }}">
<block wx:if="{{uninstallDesc.status == '2'}}">
<button class="complete-btn" bindtap="uninstallDesc">拆机</button>
</block>
<block wx:if="{{uninstallDesc.status == '3'}}">
<button class="complete-btn cancel-btn" bindtap="operate" data-type="7">报废</button>
<button class="complete-btn" bindtap="operate" data-type="9">入库</button>
</block>
</view> </view>
</view>
<van-popup show="{{ UninstallDate }}" bind:close="changeUninstallDate" safe-area-inset-bottom position="bottom" close-on-click-overlay>
<van-datetime-picker bind:cancel="changeUninstallDate" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
</van-popup>
<van-popup show="{{ newOrderDateShow }}" bind:close="closeNewOrder" safe-area-inset-bottom position="bottom" close-on-click-overlay>
<van-datetime-picker title="请选择上门时间" bind:cancel="closeNewOrder" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput2" />
</van-popup>

View File

@ -18,9 +18,7 @@
.info-item { .info-item {
display: flex; display: flex;
align-items: center;
margin-bottom: 16rpx; margin-bottom: 16rpx;
white-space: nowrap;
} }
.label { .label {
@ -33,6 +31,8 @@
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
flex: 1; flex: 1;
overflow: hidden;
white-space: wrap;
} }
.product-image { .product-image {
@ -60,7 +60,7 @@
width: 48%; width: 48%;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;
@ -105,7 +105,7 @@
right: -10rpx; right: -10rpx;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
@ -140,7 +140,7 @@
width: 240rpx; width: 240rpx;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
background: #ff512a; background: #2583FF;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;

View File

@ -8,6 +8,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
admin:"",
statusType: { statusType: {
1: '待分配', 1: '待分配',
2: '安装中', 2: '安装中',
@ -44,7 +45,7 @@ Page({
desc(e){ desc(e){
let that = this let that = this
wx.navigateTo({ wx.navigateTo({
url: `../orderDesc/orderDesc?install_id=${e.currentTarget.dataset.id}`, url: `../orderDesc/orderDesc?install_id=${e.currentTarget.dataset.id}&type=desc`,
}) })
}, },
addWorkOrder(){ addWorkOrder(){
@ -86,8 +87,7 @@ Page({
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
util.postUrl(apiArr.RecallNewRepair,{ util.postUrl4(apiArr.RecallNewRepair,{
status: 4,
install_id: item.install_id, install_id: item.install_id,
},res=>{ },res=>{
wx.hideLoading() wx.hideLoading()
@ -144,12 +144,11 @@ Page({
mask:true, mask:true,
}) })
//设置加载状态 //设置加载状态
util.postUrl(apiArr.newOrderList,{ util.postUrl4(apiArr.newOrderList,{
page_size:that.data.page_size, page_size:that.data.page_size,
page_num:that.data.page_num, page_num:that.data.page_num,
status: that.data.value1, search:that.data.searchText,
dealer_id: Number(wx.getStorageSync('dealer_id')), dealer_id: that.data.admin.shop_id
search:that.data.searchText
},res=>{ },res=>{
wx.hideLoading() wx.hideLoading()
if(res.row){ if(res.row){
@ -166,15 +165,17 @@ Page({
}) })
} }
that.getMasterList()
}) })
}, },
// 维修师傅列表 // 维修师傅列表
getMasterList(){ getMasterList(){
let that = this let that = this
util.postUrl(apiArr.MasterList,{ util.postUrl4(apiArr.MasterList,{
page_num:1, page_num:1,
page_size:50, page_size:50,
dealer_id:wx.getStorageSync('dealer_id') dealer_id:that.data.admin.shop_id
},res=>{ },res=>{
if(res.rows){ if(res.rows){
res.rows.forEach(item=>{ res.rows.forEach(item=>{
@ -201,6 +202,12 @@ Page({
}) })
}, },
cancel(){
let that = this
that.setData({
show:false,
})
},
sure(){ sure(){
let that = this let that = this
that.setData({ that.setData({
@ -208,10 +215,9 @@ Page({
}) })
const { sendOrders, MasterList } = this.data; const { sendOrders, MasterList } = this.data;
const checkedMaster = MasterList.filter((item) => item.checked)[0]; const checkedMaster = MasterList.filter((item) => item.checked)[0];
util.postUrl(apiArr.newInstallAssign, { util.postUrl4(apiArr.newInstallAssign, {
install_id: sendOrders.install_id, install_id: sendOrders.install_id,
master_id: checkedMaster.info_id, master_id: checkedMaster.info_id,
dealer_id: Number(wx.getStorageSync('dealer_id'))
} ,res => { } ,res => {
console.log('新装工单 选择修为师傅', res); console.log('新装工单 选择修为师傅', res);
if (res.error) { if (res.error) {
@ -225,6 +231,11 @@ Page({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
}) })
that.setData({
page_num:1,
flag:false,
deviceList:[]
})
setTimeout(()=>{ setTimeout(()=>{
that.getNewOrderList() that.getNewOrderList()
},1500) },1500)
@ -236,8 +247,15 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
let that = this let that = this
that.setData({
admin:wx.getStorageSync('admin')
})
that.getNewOrderList() that.getNewOrderList()
that.getMasterList()
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
}, },
/** /**
@ -289,6 +307,17 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage(){ onShareAppMessage(){
return {
title: '人人爱净水', // 分享卡片标题(必填)
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4
} }
},
onShareTimeline() {
return {
title: '人人爱净水', // 自定义标题
query: '', // 自定义页面路径中的参数
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
}
},
}) })

View File

@ -3,7 +3,7 @@
<view class="upkeep_select"> <view class="upkeep_select">
<view class="ipt"> <view class="ipt">
<input value="{{searchText}}" bindinput="ipt1" type="text" placeholder="工单号/客户名称/客户手机" placeholder-style="color: #999999;font-size: 24rpx;" /> <input value="{{searchText}}" bindinput="ipt1" type="text" placeholder="工单号/客户名称/客户手机" placeholder-style="color: #999999;font-size: 24rpx;" />
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png" mode="widthFix" bind:tap="search" /> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" bind:tap="search" />
</view> </view>
</view> </view>
@ -30,10 +30,7 @@
<view class="orderItem_Item_tit">工单状态</view> <view class="orderItem_Item_tit">工单状态</view>
<view class="orderItem_Item_con2">{{statusType[item.status]}}</view> <view class="orderItem_Item_con2">{{statusType[item.status]}}</view>
</view> </view>
<!-- <view class="orderItem_Item">
<view class="orderItem_Item_tit">故障描述</view>
<view class="orderItem_Item_con">{{item.install_desc}}</view>
</view> -->
<view class="orderItem_Item"> <view class="orderItem_Item">
<view class="orderItem_Item_tit">具体位置</view> <view class="orderItem_Item_tit">具体位置</view>
<view class="orderItem_Item_con">{{item.region + item.address}}</view> <view class="orderItem_Item_con">{{item.region + item.address}}</view>
@ -61,6 +58,7 @@
<view class="selectMaster"> <view class="selectMaster">
<van-popup show="{{ show }}" bind:close="onClose" close-on-click-overlay round position="bottom" z-index="99999" > <van-popup show="{{ show }}" bind:close="onClose" close-on-click-overlay round position="bottom" z-index="99999" >
<view class="pop_Tit"> <view class="pop_Tit">
<view class="cancel" bind:tap="cancel">取消</view>
请选择维修师傅 请选择维修师傅
<view class="sure" bind:tap="sure">确定</view> <view class="sure" bind:tap="sure">确定</view>
</view> </view>

View File

@ -88,7 +88,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 150rpx; width: 150rpx;
height: 50rpx; height: 50rpx;
background: #FF512A; background: #2583FF;
border-radius: 100rpx 100rpx 100rpx 100rpx; border-radius: 100rpx 100rpx 100rpx 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -111,7 +111,7 @@
color: #FFFFFF; color: #FFFFFF;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
background: #FF512A; background: #2583FF;
position: fixed; position: fixed;
right: 55rpx; right: 55rpx;
bottom: 200rpx; bottom: 200rpx;
@ -123,7 +123,7 @@
.addBtn::after { .addBtn::after {
content: ''; content: '';
background: rgba(255, 81, 42, 0.5); background: rgba(77, 154, 255,.5);
filter: blur(10.899999618530273rpx); filter: blur(10.899999618530273rpx);
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
@ -156,10 +156,21 @@
transform: translateY(-50%); transform: translateY(-50%);
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #FF512A; color: #2583FF;
position: absolute; position: absolute;
} }
.pop_Tit .cancel {
left: 0;
top: 50%;
transform: translateY(-50%);
font-weight: 400;
font-size: 28rpx;
color: #000;
position: absolute;
}
.master { .master {
padding-bottom: 40rpx; padding-bottom: 40rpx;
} }
@ -188,7 +199,7 @@
.cir1 { .cir1 {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
background: #FF512A; background: #2583FF;
box-sizing: border-box; box-sizing: border-box;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -0,0 +1,202 @@
let util = require('../../../../utils/util')
let apiArr = require('../../../../api/partner')
Page({
/**
* 页面的初始数据
*/
data: {
fileList: [],
fileList2: [],
device_code: "",
customer_name: "",
customer_phone: "",
region: "",
address: "",
deviceList: [],
fault_desc: "",
page_num: 1,
page_size: 50,
show: false,
currentDeviceInfo: ""
},
changeShow1() {
let that = this
that.setData({
show: true
})
},
getDeviceList() {
console.log(apiArr);
let that = this
util.postUrl4(apiArr.deviceList, {
page_num: that.data.page_num,
page_size: that.data.page_size,
}, res => {
that.setData({
deviceList: res.list
})
})
},
updateFault_desc(e) {
let that = this
that.setData({
fault_desc: e.detail.value
})
},
confirmPackage(e) {
let that = this
that.setData({
show: false,
currentDeviceInfo: e.detail.value,
device_code: e.detail.value.device_code
})
},
onClose() {
let that = this
that.setData({
show: false
})
},
beforeRead(e) {
let that = this
wx.showLoading({
title: '上传中',
mask: true,
})
util.uploadFileUrl(e.detail.file.url, (res) => {
wx.hideLoading()
let datas = JSON.parse(res)
console.log(datas.data);
let url = util.img_url + datas.data.path
let fileList = that.data.fileList
let fileList2 = that.data.fileList2
let obj = {
url: url,
name: 'avatar'
}
let obj2 = {
url: datas.data.path,
name: 'avatar'
}
fileList.push(obj)
fileList2.push(obj2)
that.setData({
fileList,
fileList2
})
})
},
deleteImg(e) {
console.log(e);
let that = this
let fileList = that.data.fileList
let fileList2 = that.data.fileList2
fileList.splice(e.detail.index, 1)
fileList2.splice(e.detail.index, 1)
that.setData({
fileList,
fileList2
})
},
submit() {
let that = this
if (!that.data.currentDeviceInfo.device_id) {
return wx.showToast({
title: '请选择维修设备',
icon: "none"
})
}
if (!that.data.fault_desc) {
return wx.showToast({
title: '请填写故障描述',
icon: "none"
})
}
if (!that.data.fileList.length) {
return wx.showToast({
title: '请上传故障图片',
icon: "none"
})
}
util.postUrl4(apiArr.createRepairOrder, {
device_code: that.data.currentDeviceInfo.device_code,
appointment_time: '',
fault_desc: that.data.fault_desc,
fault_imgs: that.data.fileList2[0].url
}, res => {
wx.showToast({
title: '创建成功!',
icon: "none"
})
setTimeout(()=>{
wx.navigateBack({
delta:1
})
},1500)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this
that.getDeviceList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,108 @@
<view class="newWorkOrder">
<view class="form">
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
维修设备
</view>
<view class="formItem_con" bind:tap="changeShow1">
<input type="text" placeholder="请选择维修设备" value="{{device_code}}" />
</view>
</view>
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
用户姓名
</view>
<view class="formItem_con">
<input type="text" disabled placeholder="请输入用户姓名" bindinput="changeCustomerName" value="{{currentDeviceInfo.customer_name}}" />
</view>
</view>
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
用户电话
</view>
<view class="formItem_con">
<input type="number" disabled placeholder="请输入用户电话" maxlength="11" bindinput="changeCustomerPhone" value="{{currentDeviceInfo.customer_phone}}" />
</view>
</view>
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
所在区域
</view>
<view class="formItem_con" bind:tap="headerAreaClick">
<input type="text" value="{{currentDeviceInfo.region}}" disabled placeholder='请选择您所在的区域' placeholder-style="font-size: 26rpx;color:#999" />
</view>
</view>
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
详细地址
</view>
<view class="formItem_con">
<input type="text" disabled placeholder="请输入详细地址" bindinput="changeAddress" value="{{currentDeviceInfo.address}}" />
</view>
</view>
<view class="formItem">
<view class="formItem_tit">
<view class="icon">*</view>
故障描述
</view>
<view class="formItem_con">
<input type="text" bindinput="updateFault_desc" placeholder="请输入故障描述" value="{{fault_desc}}" />
</view>
</view>
<view class="formItem2">
<view class="formItem_tit">
<view class="icon">*</view>
故障图片
</view>
<view class="formItem_con2">
<van-uploader file-list="{{ fileList }}"
max-count="1"
before-read="beforeRead"
bind:after-read="beforeRead"
bind:delete="deleteImg"
upload-icon="plus" />
</view>
</view>
<view class="submit" bind:tap="submit">
提交
</view>
</view>
</view>
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom">
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage" columns="{{ deviceList }}" value-key="device_code" />
</van-popup>
<van-popup show="{{ show3 }}" safe-area-inset-bottom lock-scroll bind:close="onClose3" round close-on-click-overlay position="bottom">
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage3" columns="{{ masterList }}" value-key="name" />
</van-popup>
<van-popup show="{{ show4 }}" bind:close="onClose4" safe-area-inset-bottom position="bottom" close-on-click-overlay>
<van-datetime-picker bind:cancel="onClose4" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
</van-popup>

Some files were not shown because too many files have changed in this diff Show More