页面优化

This commit is contained in:
itgaojian163 2025-04-09 15:22:05 +08:00
parent 3b6b3d8396
commit 27408ba229
12 changed files with 176 additions and 44 deletions

View File

@ -11,6 +11,8 @@ Page({
allPrice: 0,
materialPrice: 0,
isUrgent: false, //是否加急
showSuccess: false,
successHint: ''
},
/**
@ -85,5 +87,21 @@ Page({
wx.navigateTo({
url: '../createProjectInfo/createProjectInfo?type=' + type + '&price=' + price + '&isUrgent=' + urgent
})
},
//点击复制
copyLink() {
const _self = this
wx.setClipboardData({
data: 'https://www.aimzhu.com',
success: () => {
_self.setData({
successHint: '复制成功',
showSuccess: true
})
},
fail: err => {
console.log(err)
}
})
}
})

View File

@ -1,3 +1,3 @@
{
"usingComponents": {}
"usingComponents": {"mp-toptips": "weui-miniprogram/toptips/toptips"}
}

View File

@ -73,13 +73,13 @@
</view>
</view>
</view>
<view class="buy-desc-column box-bottom-options mt-20">
<!-- <view class="buy-desc-column box-bottom-options mt-20">
<checkbox-group bindchange="doUrgent">
<checkbox class="custom-wx-checkbox">
<tex style="color: #532A00;padding-left: 10rpx;font-weight: 400;">加急办理{{urgent/100}}元</tex>
</checkbox>
</checkbox-group>
</view>
</view> -->
</view>
</view>
<!-- 写材料 -->
@ -148,11 +148,12 @@
</view>
</view>
<!-- 提示免费版 -->
<view class="hint-box pd-20">
<view class="hint-box pd-20" bind:tap="copyLink">
<view class="icon icon-computer-ind"></view>
<view class="content">
<text class="hint-content">免费试用请使用电脑端登录</text>
<text class="hint-link">www.aimzhu.com</text>
<text class="hint-link">https://www.aimzhu.com</text>
</view>
</view>
</view>
</view>
<mp-toptips msg="{{successHint}}" delay="2000" type="success" show="{{showSuccess}}"></mp-toptips>

View File

@ -25,7 +25,6 @@ Page({
tempCoupons: {}, //临时选中的优惠卷,没有点击确定按钮
contactList: [], //联系人
selectContact: {}, //当前选中的联系人
showCreateContact: false, //显示创建联系人
contactPhone: '', //联系人电话
contactName: '', //联系人姓名
contactEmail: '', //联系人邮箱
@ -47,6 +46,10 @@ Page({
tempLang: '', //临时选中的语言
selectLang: '',
contactCompany: '', //联系人公司
isShowUrgent: true, //是否加急
urgent: 0, //加急费用
isUrgentDisable: false, //是否禁用加急
proPrice: 0, //价格
},
onLoad(options) {
wx.setNavigationBarTitle({
@ -63,9 +66,11 @@ Page({
const typeParams = options.type //类型
const priceParams = options.price //价格
const isUrgentParams = options.isUrgent
console.log(priceParams)
if (priceParams && priceParams > 0) {
this.setData({
price: priceParams,
proPrice: priceParams,
type: typeParams,
isUrgent: isUrgentParams
})
@ -76,6 +81,15 @@ Page({
})
wx.navigateBack()
}
if (this.data.type == 'ALL') {
this.setData({
isShowUrgent: true
})
} else {
this.setData({
isShowUrgent: false
})
}
//获取项目联系人
this.doGetContactList()
//获取套餐包
@ -86,6 +100,30 @@ Page({
this.doGetCsaNo(false)
//获取可选语言
this.doGetProLangList()
//获取加急等费用
this.doGetPrice()
},
//获取单价
doGetPrice() {
wx.showLoading({
title: '加载中...',
})
const _self = this
ProjectService.doGetPrice()
.then(res => {
console.log(res)
_self.setData({
urgent: res.additional.urgent, //加急办理
})
}, err => {
wx.showToast({
title: '数据有误,请稍后重试',
icon: 'error',
success: () => {
wx.navigateBack()
}
})
})
},
//系统版本
inputVersion(e) {
@ -94,6 +132,22 @@ Page({
version: e.detail.value
})
},
//是否加急
doUrgent() {
const _self = this
_self.setData({
isUrgent: !_self.data.isUrgent
})
var newPrice = Number(_self.data.price)
if (_self.data.isUrgent) {
newPrice = Number(_self.data.price) + Number(_self.data.urgent)
} else {
newPrice = Number(_self.data.price) - Number(_self.data.urgent)
}
_self.setData({
price: newPrice
})
},
//开发完成时间
bindDateChange(e) {
console.log(e)
@ -168,14 +222,19 @@ Page({
},
//确定使用选中的优惠卷
confirmSelCoupons() {
this.setData({
selectCoupons: this.data.tempCoupons,
const _self = this
_self.setData({
selectCoupons: _self.data.tempCoupons,
showCoupons: false,
tempCoupons: {},
canSelPackage: false,
selectPackage: {},
tempPackage: {}
})
var newPrice = Number(_self.data.price) - Number(_self.data.selectCoupons.coupon.amount)
_self.setData({
price: newPrice > 0 ? newPrice : 0
})
},
//监听项目名称
inputProjectName(e) {
@ -305,7 +364,10 @@ Page({
tempPackage: {},
canSelCoupons: false,
selectCoupons: {},
tempCoupons: {}
tempCoupons: {},
isUrgent: false, //取消加急
isUrgentDisable: true, //加急不能选择
price: 0
})
},
//取消选中的套餐包或优惠卷
@ -316,7 +378,10 @@ Page({
tempCoupons: {},
tempPackage: {},
canSelCoupons: true,
canSelPackage: true
canSelPackage: true,
isUrgent: false, //取消加急
isUrgentDisable: false, //加急可以选择
price: this.data.proPrice, //重置价格
})
},
//点击选择套餐包
@ -403,7 +468,7 @@ Page({
_self.doGetCsaNo(true)
} else {
_self.setData({
showCreateContact: true
isShowContact: true
})
}
},
@ -434,18 +499,18 @@ Page({
return
}
}
const data = {
company: _self.data.contactCompany,
csaNo: _self.data.csaNo,
name: _self.data.contactName,
phone: _self.data.contactPhone,
email: _self.data.email
}
wx.showLoading({
title: '创建中...',
})
const data = {
"company": _self.data.contactCompany,
"csaNo": _self.data.csaNo,
"name": _self.data.contactName,
"phone": _self.data.contactPhone
}
UserService.doCreateContact(data)
.then(res => {
wx.hideLoading()
_self.setData({
showSuccess: true,
successHint: '新建成功',
@ -453,18 +518,22 @@ Page({
contactEmail: '',
contactPhone: '',
contactName: '',
contactCompany:'',
contactCompany: '',
})
//获取一遍联系人
_self.doGetContactList()
}, err => {
wx.hideLoading()
})
.catch(err => {
_self.setData({
showError: true,
errorHint: err.msg ? err.msg : '新建失败,请稍后重试',
isShowContact: false
})
})
.finally(() => {
console.log('finally')
wx.hideLoading()
})
},
//创建项目
doCreateProject() {

View File

@ -45,7 +45,7 @@
<view class="label">开发完成时间</view>
<picker style="flex:1;" mode="date" value="{{date}}" start="2010-01-01" end="2050-01-01" bindchange="bindDateChange">
<view class="desc">
<view>{{completeDate}}</view>
<view style="color:rgba(0,0,0,0.8)">{{completeDate}}</view>
<view class="icon icon-calendar-ind"></view>
</view>
</picker>
@ -69,32 +69,37 @@
</view>
</view>
<view class="bottom-box">
<view class="money">金额:
<text class="price">{{price/100}}元</text>
<view class="money">
<view>金额:<text class="price">{{price/100}}元</text></view>
<checkbox-group class="custom-checkbox" bindchange="doUrgent" wx:if="{{isShowUrgent}}">
<checkbox checked="{{isUrgent}}" class="custom-wx-checkbox" disabled="{{isUrgentDisable}}">
<tex style="color: #532A00;padding-left: 3rpx;font-weight: 400;">加急办理{{urgent/100}}元</tex>
</checkbox>
</checkbox-group>
</view>
<view class="btn" bind:tap="doCreateProject">保存并付款</view>
</view>
</view>
<mp-half-screen-dialog show="{{showCreateContact}}">
<mp-half-screen-dialog show="{{isShowContact}}">
<view slot="title">创建联系人</view>
<view slot="desc">
<view class="form-box">
<view class="form-item">
<view class="form-item-title">姓名</view>
<input value="{{contactName}}" placeholder="请输入联系人姓名" class="form-item-content" bindinput="inputContactName" />
<input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactName}}" placeholder="请输入联系人姓名" class="form-item-content" bindinput="inputContactName" />
</view>
<view class="form-item">
<view class="form-item-title">联系电话</view>
<input value="{{contactPhone}}" placeholder="请输入联系电话" class="form-item-content" bindinput="inputContactPhone" />
<input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactPhone}}" placeholder="请输入联系电话" class="form-item-content" bindinput="inputContactPhone" />
</view>
<view class="form-item">
<view class="form-item-title no-after">联系邮箱</view>
<input value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" />
<input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" />
</view>
<view class="form-item">
<view class="form-item-title no-after">公司</view>
<input value="{{contactCompany}}" placeholder="请输入公司名称" class="form-item-content" bindinput="inputContactCompany" />
<input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactCompany}}" placeholder="请输入公司名称" class="form-item-content" bindinput="inputContactCompany" />
</view>
</view>
</view>
@ -108,11 +113,13 @@
<view slot="desc">
<textarea bindinput="inputCommendProjectName" placeholder="请简单介绍您想创建的系统,我们会根据您的描述为您推荐系统全称" style="border: 1px solid #f2f2f2;width: 82vw;padding: 10px;height: 50px;"></textarea>
<!-- 推荐回来的列表 -->
<view class="project-box">
<block wx:for="{{projectNameList}}" wx:key="index">
<view class="project-item" bind:tap="doSelectProjectName" data-value="{{item}}">{{item}}</view>
</block>
</view>
<scroll-view scroll-y style="height: 300px;">
<view class="project-box">
<block wx:for="{{projectNameList}}" wx:key="index">
<view class="project-item" bind:tap="doSelectProjectName" data-value="{{item}}">{{item}}</view>
</block>
</view>
</scroll-view>
</view>
<view slot="footer" style="height: 0px;">
<button type="primary" bind:tap="doCreateFullName">生成</button>

View File

@ -4,6 +4,38 @@ page {
background-repeat: no-repeat;
}
.custom-checkbox {
font-size: 14px;
margin-left: 14px;
}
.custom-wx-checkbox .wx-checkbox-input.wx-checkbox-input-checked {
color: #fff !important;
background-color: #FFA900;
border: 1px solid #FFA900;
}
.custom-wx-checkbox .wx-checkbox-input {
-webkit-appearance: none;
appearance: none;
margin-bottom: 3px;
outline: 0;
text-indent: 0;
width: 32rpx;
height: 32rpx;
background-color: transparent;
position: relative;
border: 1rpx solid #FFA900;
box-sizing: border-box;
text-align: center;
}
/*钩大小*/
.custom-wx-checkbox .wx-checkbox-input.wx-checkbox-input-checked:before {
font-size: 32rpx;
text-align: center;
}
.create-container {
display: flex;
flex-direction: column;
@ -168,6 +200,8 @@ page {
.bottom-box .money {
color: #532A00;
font-size: 20px;
display: flex;
flex-direction: row;
}
.price {

View File

@ -460,7 +460,6 @@ Page({
_self.setData({
successHint: '本次领取操作已成功,您可以在 “我的” 页面查看相关信息。',
showSuccess: true,
showAd: false
})
})
.catch(err => {
@ -468,7 +467,6 @@ Page({
_self.setData({
errorHint: err.msg ? err.msg : '本次领取操作未成功,请重新进入小程序后再次尝试。',
showError: true,
showAd: false
})
})
}

View File

@ -249,7 +249,7 @@
.project-status {
font-size: 12px;
color: #FE9944;
color: rgba(16, 16, 16, 1);
font-weight: 400;
flex: .3;
padding-left: 5px;

View File

@ -35,7 +35,7 @@
<view class="v-divide"></view>
<view class="r-tickets">
<view class="r-title">{{item.coupon.title}}</view>
<view class="r-time">{{item.coupon.useGmtStart}}-{{item.coupon.useGmtEnd}}</view>
<view class="r-time">{{tools.timeSplit(item.coupon.useGmtStart)}}-{{tools.timeSplit(item.coupon.useGmtEnd)}}</view>
</view>
</view>
</block>

View File

@ -125,7 +125,7 @@ page {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;
align-items: baseline;
padding: 10px;
}

View File

@ -8,7 +8,7 @@
<view class="content-container">
<container-loading loadingState="{{loadingState}}" style="height: 85vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 85vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view class="order-box">
<view class="order-box" style="padding-bottom: 30px;">
<block wx:for="{{orderList}}" wx:key="index">
<view class="order-item">
<view class="order-title">
@ -21,8 +21,8 @@
<view class="order-types">
<view class="or-type">{{tools.proType(detail.productType)}}</view>
<view class="or-count">数量{{detail.quantity}}</view>
<view class="or-price">单价{{detail.unitPrice}}</view>
<view class="or-total">总金额{{item.totalAmount}}</view>
<view class="or-price">单价{{detail.unitPrice/100}}</view>
<view class="or-total">总金额{{item.totalAmount/100}}</view>
</view>
<view class="order-remark-box">
<view class="order-remark-title">订单备注</view>

View File

@ -97,6 +97,10 @@ var fontColor = function (value) {
}
return str
}
var timeSplit = function (value) {
var regex = getRegExp('-', 'g');
return value.replace(regex, '.')
}
module.exports = {
isEmpty: isEmpty,
@ -104,5 +108,6 @@ module.exports = {
orderStatus: orderStatus,
proType: proType,
boderStyle: boderStyle,
fontColor: fontColor
fontColor: fontColor,
timeSplit: timeSplit
};