静态轮播图,创建项目页面

This commit is contained in:
itgaojian163 2025-03-29 15:54:33 +08:00
parent 8998dc9fb4
commit 57873737c2
11 changed files with 486 additions and 97 deletions

View File

@ -1,13 +1,10 @@
<view class="buy-container">
<swiper indicator-dots style="height: 120rpx;" indicator-active-color="#fff">
<swiper indicator-dots style="height: 120rpx;" autoplay indicator-active-color="#fff">
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 120rpx;"></image>
<image src="/static/images/banner_1.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 120rpx;"></image>
<image src="/static/images/banner_2.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
</swiper>
<!-- 全托管 -->

View File

@ -17,8 +17,24 @@ Page({
isShowContact: false, //是否显示联系人
currentLanguage: 'JAVA', //当前选中的语言
price: 0,
packageList: [], //套餐包
couponsList: [], //优惠卷
packageList: [{
id: 1
}, {
id: 2
}, {
id: 3
}], //套餐包
tempPackage: {}, //临时选中的优惠卷,没有点击确定按钮前
selectPackage: {}, //选中的套餐包
couponsList: [{
id: 1
}, {
id: 2
}, {
id: 3
}], //优惠卷
selectCoupons: {}, //选中的优惠卷
tempCoupons: {}, //临时选中的优惠卷,没有点击确定按钮
contactList: [], //联系人
selectContact: {}, //当前选中的联系人
showCreateContact: false, //显示创建联系人
@ -34,6 +50,10 @@ Page({
projectName: '',
projectNameList: [],
isUrgent: false, //是否加急
showCoupons: false, //显示优惠卷
showPackage: false, //显示套餐包
canSelCoupons: true, //是否可以使用优惠卷
canSelPackage: true, //是否可以使用套餐包
},
onLoad(options) {
wx.setNavigationBarTitle({
@ -111,6 +131,23 @@ Page({
contactEmail: e.detail.value
})
},
//选中优惠卷
selectCoupons(e) {
this.setData({
tempCoupons: e.currentTarget.dataset.value
})
},
//确定使用选中的优惠卷
confirmSelCoupons() {
this.setData({
selectCoupons: this.data.tempCoupons,
showCoupons: false,
tempCoupons: {},
canSelPackage: false,
selectPackage: {},
tempPackage: {}
})
},
//监听项目名称
inputProjectName(e) {
this.setData({
@ -153,13 +190,82 @@ Page({
},
//获取优惠卷
doGetCoupons() {
ProjectService.doGetCouponseList()
const _self = this
const data = {
page: 1,
rows: 100,
isEffective: 1,
isUsed: 0
}
ProjectService.doGetCouponseList(data)
.then(res => {
console.log('优惠卷')
console.log(res)
// _self.setData({
// couponsList: res.rows
// })
}, err => {
console.log(err)
})
},
//显示优惠卷
doShowCoupons() {
if (this.data.couponsList.length <= 0) {
this.setData({
showError: true,
errorHint: '您没有可以使用的优惠卷'
})
} else {
this.setData({
tempCoupons: this.data.selectCoupons,
showCoupons: !this.data.showCoupons
})
}
},
//显示套餐包
doShowPackage() {
const _self = this
if (_self.data.packageList.length > 0) {
_self.setData({
tempPackage: _self.data.selectPackage,
showPackage: true
})
} else {
_self.setData({
errorHint: '您暂时没有可以使用的套餐包',
showError: true
})
}
},
//确定套餐包
confirmSelectPackage() {
this.setData({
selectPackage: this.data.tempPackage,
showPackage: false,
tempPackage: {},
canSelCoupons: false,
selectCoupons: {},
tempCoupons: {}
})
},
//取消选中的套餐包或优惠卷
clearSelectPackageOrCoupons() {
this.setData({
selectCoupons: {},
selectPackage: {},
tempCoupons: {},
tempPackage: {},
canSelCoupons: true,
canSelPackage: true
})
},
//点击选择套餐包
selectPackage(e) {
console.log(e)
this.setData({
tempPackage: e.currentTarget.dataset.value
})
},
//获取客服NO
doGetCsaNo(isShow) {
const _self = this

View File

@ -1,78 +1,78 @@
<view class="create-container">
<swiper indicator-dots style="height: 150rpx;" indicator-active-color="#fff">
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 150rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 150rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 150rpx;"></image>
</swiper-item>
</swiper>
<view class="info-box">
<view class="info-title">项目信息</view>
<input value="{{projectName}}" bindinput="inputProjectName" class="info-value" placeholder="请输入系统全称(注:建议以'软件''平台''系统'等字眼结尾)" />
<view class="info-btn" bind:tap="doCommendProjectName">推荐</view>
</view>
<view class="content-box">
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label">产权联系人</text>
<picker style="flex:1;" mode="selector" range="{{contactList}}" range-key="name" bindchange="doChangeContact">
<view style="display: flex;align-items: center;">
<view style="font-size: 13px;text-align: center;flex:1;">{{selectContact.name}}</view>
<view class="icon-arrow-down-line" style="width: 24rpx;height: 24rpx;margin-right: 20px;"></view>
</view>
</picker>
<view class="link" bind:tap="doCreateContact">新建</view>
</view>
<view class="item">
<view class="flex-1">
<text class="label" style="flex: 1;">系统版本</text>
<input class="value" placeholder="v1.0" style="flex:1;" value="{{version}}" bindinput="inputVersion" />
</view>
<view class="flex-1">
<text class="label">系统语言</text>
<view class="value selection-box ml-20">
<view class="container-box">
<swiper indicator-dots style="height: 120rpx;" autoplay indicator-active-color="#fff">
<swiper-item>
<image src="/static/images/banner_1.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
<swiper-item>
<image src="/static/images/banner_2.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
</swiper>
<view class="info-box">
<view class="info-title">项目信息</view>
<input value="{{projectName}}" bindinput="inputProjectName" class="info-value" placeholder="请输入系统全称(注:建议以'软件''平台''系统'等字眼结尾)" />
<view class="info-btn" bind:tap="doCommendProjectName">推荐</view>
</view>
<view class="content-box">
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label">产权联系人</text>
<picker style="flex:1;" mode="selector" range="{{contactList}}" range-key="name" bindchange="doChangeContact">
<view style="display: flex;align-items: center;">
<view class="language-sel" bindtap="toggleOptions">{{currentLanguage}}</view>
<view class="icon-arrow-down-line" style="width: 28rpx;height: 28rpx;"></view>
<view style="font-size: 13px;text-align: center;flex:1;">{{selectContact.name}}</view>
<view class="icon-arrow-down-line" style="width: 24rpx;height: 24rpx;margin-right: 20px;"></view>
</view>
<view class="language-options" wx:if="{{isShowLanguage}}">
<view class="option" wx:for="{{languageList}}" wx:key="index" data-value="{{item}}" bindtap="selectOption">
{{item}}
</picker>
<view class="link" bind:tap="doCreateContact">新建</view>
</view>
<view class="item">
<view class="flex-1">
<text class="label" style="flex: 1;">系统版本</text>
<input class="value" placeholder="v1.0" style="flex:1;" value="{{version}}" bindinput="inputVersion" />
</view>
<view class="flex-1">
<text class="label">系统语言</text>
<view class="value selection-box ml-20">
<view style="display: flex;align-items: center;">
<view class="language-sel" bindtap="toggleOptions">{{currentLanguage}}</view>
<view class="icon-arrow-down-line" style="width: 28rpx;height: 28rpx;"></view>
</view>
<view class="language-options" wx:if="{{isShowLanguage}}">
<view class="option" wx:for="{{languageList}}" wx:key="index" data-value="{{item}}" bindtap="selectOption">
{{item}}
</view>
</view>
</view>
</view>
</view>
<view class="item">
<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 class="icon icon-calendar-ind"></view>
</view>
</picker>
</view>
</view>
<view class="item">
<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 class="icon icon-calendar-ind"></view>
</view>
</picker>
</view>
</view>
<!-- 第二部分 -->
<view class="section">
<view class="item" style="justify-content: space-between;">
<text class="label">套餐包</text>
<text class="value">暂无套餐包</text>
</view>
<view class="item">
<text class="label">优惠券</text>
<text class="desc">请选择优惠券</text>
<text class="link" bindtap="selectCoupon">选择</text>
<!-- 第二部分 -->
<view class="section">
<view wx:if="{{canSelPackage}}" class="item" style="justify-content: space-between;">
<text class="label">套餐包</text>
<text class="value" style="flex: 1;text-align: right;" bind:tap="doShowPackage">{{selectPackage.id?selectPackage.id:'请选择套餐包'}}</text>
<text wx:if="{{!tools.isEmpty(selectPackage)}}" class="link" bind:tap="clearSelectPackageOrCoupons">取消</text>
</view>
<view wx:if="{{canSelCoupons}}" class="item">
<text class="label">优惠券</text>
<text style="flex:1;text-align: right;padding-right: 10px;color: #555;font-size: 14px;">{{selectCoupons.id? selectCoupons.id : '请选择优惠券'}}</text>
<text class="link" wx:if="{{!tools.isEmpty(selectCoupons)}}" bind:tap="clearSelectPackageOrCoupons">取消</text>
<text class="link" bindtap="doShowCoupons" wx:if="{{tools.isEmpty(selectCoupons)}}">选择</text>
</view>
</view>
</view>
</view>
<view class="bottom-box">
<view class="money">金额:
<text class="price">{{price/100}}元</text>
@ -80,6 +80,7 @@
<view class="btn" bind:tap="doCreateProject">保存并付款</view>
</view>
</view>
<mp-half-screen-dialog show="{{showCreateContact}}">
<view slot="title">创建联系人</view>
<view slot="desc">
@ -93,7 +94,7 @@
<input value="{{contactPhone}}" placeholder="请输入联系电话" class="form-item-content" bindinput="inputContactPhone" />
</view>
<view class="form-item">
<view class="form-item-title">联系邮箱</view>
<view class="form-item-title no-after">联系邮箱</view>
<input value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" />
</view>
</view>
@ -102,7 +103,7 @@
<button type="primary" bind:tap="doSaveContact">创建</button>
</view>
</mp-half-screen-dialog>
<!-- 推荐系统名称 -->
<mp-half-screen-dialog show="{{showCommendProject}}" maskClosable="{{false}}">
<view slot="title">推荐系统全称</view>
<view slot="desc">
@ -118,6 +119,67 @@
<button type="primary" bind:tap="doCreateFullName">生成</button>
</view>
</mp-half-screen-dialog>
<!-- 优惠卷弹窗 -->
<mp-half-screen-dialog show="{{showCoupons}}">
<view slot="title">优惠卷</view>
<view slot="desc">
<view class="coupons-list-box">
<radio-group>
<block wx:for="{{couponsList}}" wx:key="index">
<view class="tickets" bind:tap="selectCoupons" data-value="{{item}}">
<view class="l-tickets">
<view class="ticket-title">
<view style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
<view class="coupons-icon" style="width: 24px;height: 24px;">
</view>
<text>优惠卷</text>
</view>
<view>减5元</view>
</view>
<view class="ticket-content">5元优惠卷</view>
<view class="ticket-desc">有效期:2025-02-07至2025-04-30</view>
</view>
<view class="r-tickets">
<radio class="custom-radio" style="margin-left: 5px;" checked="{{tempCoupons.id==item.id}}"></radio>
</view>
</view>
</block>
</radio-group>
</view>
</view>
<view slot="footer">
<button class="confirm-btn" style="margin-top: 10px;" bind:tap="confirmSelCoupons">确定</button>
</view>
</mp-half-screen-dialog>
<!-- 套餐包 -->
<mp-half-screen-dialog show="{{showPackage}}">
<view slot="title">套餐包</view>
<view slot="desc">
<view class="coupons-list-box">
<radio-group>
<block wx:for="{{packageList}}" wx:key="index">
<view class="tickets" bind:tap="selectPackage" data-value="{{item}}">
<view class="l-tickets">
<view class="ticket-title">
<view>套餐包</view>
<view>剩余13件</view>
</view>
<view class="ticket-content">60元一件撰写材料包</view>
<view class="ticket-desc">平均全托管一件220元</view>
</view>
<view class="r-tickets">
<radio class="custom-radio" style="margin-left: 5px;" checked="{{tempPackage.id==item.id}}"></radio>
</view>
</view>
</block>
</radio-group>
</view>
</view>
<view slot="footer">
<button class="confirm-btn" style="margin-top: 10px;" bind:tap="confirmSelectPackage">确定</button>
</view>
</mp-half-screen-dialog>
<mp-toptips msg="{{errorHint}}" type="error" show="{{showError}}"></mp-toptips>
<mp-toptips msg="{{successHint}}" type="success" show="{{showSuccess}}"></mp-toptips>
<mp-toptips msg="{{successHint}}" type="success" show="{{showSuccess}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,10 @@
<view class="page-container">
<swiper indicator-dots style="height: 180rpx;" indicator-active-color="#fff">
<swiper indicator-dots style="height: 120rpx;" autoplay indicator-active-color="#fff">
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 180rpx;"></image>
<image src="/static/images/banner_1.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 180rpx;"></image>
</swiper-item>
<swiper-item>
<image src="https://img.shetu66.com/2023/08/23/1692758684593196.jpg" style="width: 100vw;height: 180rpx;"></image>
<image src="/static/images/banner_2.png" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
</swiper>
<!-- 充值金额输入 -->

View File

@ -18,6 +18,12 @@ Page({
csaNo: '',
isAgree: false, //是否同意协议
contactName: '', //联系人姓名
errorHint: '',
showError: false,
successHint: '',
showSuccess: false,
infoHint: '',
showInfo: false,
},
/**
@ -47,10 +53,9 @@ Page({
})
//1未绑定 0绑定
if (res.isNew == 1) {
wx.showToast({
title: '为了给您带来更便捷、个性化的服务,需要您提供手机号,完成注册流程,请点击授权登录',
icon: 'none',
duration: 3000,
_self.setData({
infoHint: '为了给您带来更便捷、个性化的服务,需要您提供手机号,完成注册流程,请点击授权登录',
showInfo: true
})
} else {
//保存token
@ -76,7 +81,7 @@ Page({
doShowExit() {
wx.showModal({
title: '提示',
content: '您未授权,请重新打开小程序,进行授权',
content: '应用需授权才能运行,因未授权将退出.重新打开完成授权,就能继续体验.',
showCancel: false,
complete: (res) => {
if (res.confirm) {
@ -185,9 +190,9 @@ Page({
//判断名称是否为空
const _self = this
if (_self.data.contactName == '') {
wx.showToast({
title: '请输入联系人姓名',
icon: 'error'
_self.setData({
errorHint:'请输入联系人姓名',
showError:true
})
return
}

View File

@ -1,5 +1,6 @@
{
"usingComponents": {
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog"
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
"mp-toptips": "weui-miniprogram/toptips/toptips"
}
}

View File

@ -28,4 +28,7 @@
<view slot="footer">
<button type="primary" class="weui-btn" bind:tap="doCreateOwn">创建</button>
</view>
</mp-half-screen-dialog>
</mp-half-screen-dialog>
<mp-toptips msg="{{errorHint}}" type="error" show="{{showError}}"></mp-toptips>
<mp-toptips msg="{{successHint}}" type="success" show="{{showSuccess}}"></mp-toptips>
<mp-toptips msg="{{infoHint}}" type="info" show="{{showInfo}}"></mp-toptips>

BIN
static/images/banner_1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
static/images/banner_2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

9
utils/comm.wxs Normal file
View File

@ -0,0 +1,9 @@
var isEmpty = function (obj) {
if (obj == null) return true;
if (typeof obj !== 'object') return false;
return JSON.stringify(obj) === '{}';
};
module.exports = {
isEmpty: isEmpty
};