对接登录,首页列表,通知

This commit is contained in:
itgaojian163 2025-03-28 18:36:17 +08:00
parent 998aaa715e
commit 8998dc9fb4
25 changed files with 994 additions and 288 deletions

View File

@ -37,5 +37,8 @@
"lazyCodeLoading": "requiredComponents",
"usingComponents": {
"ad-popup": "./components/ad-popup/ad-popup"
},
"useExtendedLib": {
"weui": true
}
}

View File

@ -123,6 +123,15 @@ page {
align-self: center;
}
.divider-h {
width: 1px;
height: 10px;
background-color: #e7e4e4;
padding: 0px 1px;
margin-left: 10px;
align-self: center;
}
.divider-v-100 {
height: 1rpx;
background-color: #F0F0F0;

View File

@ -4,6 +4,10 @@
<image src="/static/images/load_err.png" class="loading_err"></image>
<text style="align-self: center;margin-top: 10px;color: #cecece;">加载失败</text>
</view>
<view wx:elif="{{loadingVisible=='empty'}}" class="error-box">
<image src="/static/images/load_err.png" class="loading_err"></image>
<text style="align-self: center;margin-top: 10px;color: #cecece;">暂无数据</text>
</view>
<block wx:else="{{loadingVisible=='success'}}">
<slot></slot>
</block>

View File

@ -1,29 +0,0 @@
import {
request
} from "../http";
// 公共API
const apiPath = {
investDetail: "/news-content/listpage?rows=1&page=1", //投资优势
doGetDealPrivacy: "/app/agreementportal/getrelease/",
serivceId: "68eee8f5-33d3-4246-aeee-a33956677101", //服务协议
privacyId: "93679af4-e264-4d1c-bd49-538028daa95d" //隐私条款
}
class CommonService {
static doGetInvestDetail(data) {
return request(apiPath.investDetail, "GET", data)
}
static doGetPrivacy(data) {
var id = ""
switch (data) {
case "privacy":
id = apiPath.privacyId
break;
case "service":
id = apiPath.serivceId
break;
}
return request(apiPath.doGetDealPrivacy + id, "GET", null)
}
}
export default CommonService;

View File

@ -1,42 +0,0 @@
import {
request
} from "../http";
// 管理地址
const apiPath = {
domainCategory: "/news-directories/list?directoriesParentId=b04b4dc3-020a-4a9f-a567-464d27f70b19", //特色产业
keyEnterprise: "/query/sql/q2984a0f", //重点企业
domainInfo: "/news-content/listpage?newsDirectoriesId=2c76e2a0-37b2-4144-9d92-64376e5a22c3", //产业基础
industryArea: "/news-content/listpage?newsDirectoriesId=df975b5b-74bf-4c5d-a4bc-10acb6f32e81", //产业园区
plates: "/news-content/listpage?newsDirectoriesId=40d9b2e3-a609-4f45-9833-acbfdb16ce56", //产业图谱
newDetail: "/news-content/listpage", //详情
detail: "/news-content/get/"
}
class DomainService {
static doGetDomainCategory() {
return request(apiPath.domainCategory, "GET")
}
static doGetKeyEnterprise() {
return request(apiPath.keyEnterprise, "GET")
}
static doGetKeyEnterprise(data) {
return request(apiPath.keyEnterprise, "GET", data)
}
static doGetDomainInfo() {
return request(apiPath.domainInfo, "GET")
}
static doGetIndustryArea() {
return request(apiPath.industryArea, "GET")
}
static doGetPlates() {
return request(apiPath.plates, "GET")
}
static doGetDetail(data) {
return request(apiPath.newDetail, "GET", data)
}
static doDetail(url) {
return request(apiPath.detail + url, "GET")
}
}
export default DomainService;

View File

@ -1,50 +0,0 @@
import {
request
} from "../http";
// 管理地址
const apiPath = {
descVideo: "/news-content/listpage?newsDirectoriesId=9532d411-15c5-4c9c-8d73-e9f68a482702",
descInfo: "/news-content/listpage?newsDirectoriesId=91a98b33-1133-4935-8c4c-9b37cc5fe63b&rows=1&page=1",
statistics: "/query/sql/q9ce6963",
invest: "/query/sql/q428ea76",
investAreaInfo: "/news-content/listpage?rows=1&page=1", //地区概况 //资源条件 //气候条件 //基础设施
categoryList: "/news-directories/list", //投资优势 投资环境
superiosityDetail: "/news-content/listpage?rows=1&page=1", //投资优势详情
investDetail: "", //投资机会详情
}
class IndexService {
static doGetDescVideo() {
return request(apiPath.descVideo, "GET")
}
static doGetDescInfo() {
return request(apiPath.descInfo, "GET")
}
static doGetStatistics(data) {
return request(apiPath.statistics, "GET", data)
}
static doGetInvest() {
return request(apiPath.invest, "GET")
}
static doGetInvestDetail(data) {
return request(apiPath.invest, "GET", data)
}
static doGetInvestArea(data) {
return request(apiPath.investAreaInfo, "GET", data)
}
static doGetSuperiorityList() {
return request(apiPath.categoryList, "GET", {
directoriesParentId: 'c7fa126e-1fa7-4cdb-b13a-2afb2f7b48e9'
})
}
static doGetInvestAreaCategory() {
return request(apiPath.categoryList, "GET", {
directoriesParentId: 'd3ba3ff5-6d9e-4aed-9331-73e50b5ac598'
})
}
static doGetSuperiorityDetail(data) {
return request(apiPath.superiosityDetail, "GET", data)
}
}
export default IndexService;

View File

@ -1,19 +0,0 @@
import {
request
} from "../http";
// 管理地址
const apiPath = {
policyList: "/news-content/listpage", //政策列表
policyDetail: "/news-content/get/", //政策详情
}
class PolicyService {
static doGetPolicyList(data) {
return request(apiPath.policyList, "GET", data)
}
static doGetDetail(id) {
return request(apiPath.policyDetail + id, "GET")
}
}
export default PolicyService;

54
net/api/projectApi.js Normal file
View File

@ -0,0 +1,54 @@
import {
request
} from "../http";
// 公共API
const apiPath = {
getSelfProjectList: '/api/proj/listpage/self', //获取我的项目列表
getTagList: '/api/proj/tag/list-tag', //获取标签
getNotice: '/api/env/custom/get-proj-create-notice', //获取notice
getPrice: '/api/proj/charge/get', //获取创建项目的单价
getContactList: '/api/proj-contact/list/self', //获取产权联系人列表
getCouponsList: '/api/coupon/user/listpage/self', //获取优惠卷
getPackageList: '/api/proj/servicepkg/packageorder/listpage/self', //获取套餐包
getCommendProjectName: '/api/proj/recommend/list-proj-name/ai', //推荐项目名称
createProject: '/api/proj/create-quick', //快速创建项目
}
class ProjectService {
//项目列表
static doGetSelfProjectList(data) {
return request(apiPath.getSelfProjectList, 'GET', data)
}
//获取标签
static doGetTagList() {
return request(apiPath.getTagList, "GET")
}
//获取通知
static doGetNotice() {
return request(apiPath.getNotice, "GET")
}
//获取价格
static doGetPrice() {
return request(apiPath.getPrice, "GET")
}
static doGetContactList() {
return request(apiPath.getContactList, "GET")
}
//获取套餐包
static doGetPackageList(data) {
return request(apiPath.getPackageList, "GET", data)
}
//优惠卷
static doGetCouponseList(data) {
return request(apiPath.getCouponsList, "GET", data)
}
//推荐项目名称
static doGetCommendProjectName(data) {
return request(apiPath.getCommendProjectName, "POST", data)
}
//创建项目
static doCreateProject(data) {
return request(apiPath.createProject, "POST", data)
}
}
export default ProjectService;

View File

@ -1,44 +0,0 @@
import {
request
} from "../http";
// 管理地址个人习惯喜欢的下载request参数中也行
const apiPath = {
login: "/api/v1/login"
}
class AuthService {
static login(data) {
// 按住ctrl点击wx.request进入ts声明看options的类型method是均大写的对应即可
return request(apiPath.login, "GET", data)
// 由于request的参数顺序第四个才是查询参数所以如果需要传递第三个传输传空对象即可
// return request(apiPath.login, "GET", {}, data)
}
}
export default AuthService;
// import AuthService from "../../service/AuthService";
// // 导入封装好的服务层
// // 其他代码省略
// page({
// // Promise语法
// submitForm(){
// AuthService.login({username:"a",password:"2"}).then(res=>{
// // 干点别的
// },err=>{
// // 出错了干点啥
// })
// },
// // async-await语法糖
// async asycsubmitForm(){
// try{
// const res = await AuthService.login({username:"abc",password:"123"});
// // 干点别的
// }catch(err){
// // 错了干点啥?
// }
// }
// })

View File

@ -4,14 +4,22 @@ import {
// 公共API
const apiPath = {
loginUrl: '/api/user/wx/login', //登录
registerUrl: '/api/user/wx/register' //注册
registerUrl: '/api/user/wx/register', //注册,
csaNo: '/api/csa/get', //获取客服编号
createContact: '/api/proj-contact/save', //创建联系人
}
class UserService {
static doLogin(data) {
return request(apiPath.loginUrl, "POST", data)
return request(apiPath.loginUrl, "POST", data, null, 'operator', false)
}
static doRegister(data) {
return request(apiPath.registerUrl, "POST", data)
return request(apiPath.registerUrl, "POST", data, null, 'operator', false)
}
static doGetCsaNo() {
return request(apiPath.csaNo, "GET")
}
static doCreateContact(data) {
return request(apiPath.createContact, "POST", data)
}
}

View File

@ -1,6 +1,8 @@
const Cache = require('../utils/storage');
// 定义api服务地址
// const baseUrl = 'https://www.xzszwhy.cn/daqi/app';
const baseUrl = 'http://192.168.0.15:8091/operator';
const operatorUrl = 'http://192.168.0.15:8091/operator';
const copyrightUrl = 'http://192.168.0.15:7025/copyright';
/**
* 传入请求参数返回Promise支持链试调用
* @param url 请求地址
@ -8,25 +10,28 @@ const baseUrl = 'http://192.168.0.15:8091/operator';
* @param data 请求体数据
* @param params 请求参数
*/
function request(url, method = "GET", data = {}, params = {}) {
function request(url, method = "GET", data = {}, params = {}, project = "copyright", needToken = true) {
const header = {
"content-type": "application/json"
// 有其他content-type需求加点逻辑判断处理即可
}
//TODO 获取token有就丢进请求头
// const tokenString = wx.getStorageSync("access_token");
// if (tokenString) {
// header.Authorization = `Bearer ${tokenString}`;
// }
//是否需要token
if (needToken) {
const token = Cache.get('token')
if (token) {
header.Auth = `Bearer ${token}`;
}
}
//判断项目
var baseUrl = operatorUrl
if (project == 'operator') {
baseUrl = operatorUrl
} else if (project == 'copyright') {
baseUrl = copyrightUrl
} else {
baseUrl = copyrightUrl
}
return new Promise(function (resolve, reject) {
// 判断是否传递了query参数有则进行地址拼接
// if (params) {
// url += "?" + urlEncode(params)
// }
// wx.showLoading({
// title: '加载中...',
// mask: true //显示蒙层
// })
wx.request({
url: baseUrl + url,
timeout: 8000,
@ -62,6 +67,5 @@ function request(url, method = "GET", data = {}, params = {}) {
// 导出请求和服务地址
export {
request,
baseUrl
request
}

View File

@ -1,11 +1,16 @@
// pages/copyright/createBuy/createBuy.js
import ProjectService from '../../../net/api/projectApi'
Page({
/**
* 页面的初始数据
*/
data: {
urgent: 0,
projTypes: [], //全托管,写材料 type= ALL type =MATERIAL
allPrice: 0,
materialPrice: 0,
isUrgent: false, //是否加急
},
/**
@ -15,11 +20,61 @@ Page({
wx.setNavigationBarTitle({
title: '创建软著',
})
this.doGetPrice()
},
//是否加急
doUrgent(e) {
const _self = this
_self.setData({
isUrgent: !_self.data.isUrgent
})
},
//获取单价
doGetPrice() {
wx.showLoading({
title: '加载中...',
})
const _self = this
ProjectService.doGetPrice()
.then(res => {
wx.hideLoading()
console.log(res)
res.projTypes.forEach(el => {
if (el.type == 'ALL') {
_self.setData({
allPrice: el.price
})
} else if (el.type == 'MATERIAL') {
_self.setData({
materialPrice: el.price
})
}
});
_self.setData({
urgent: res.additional.urgent, //加急办理
})
}, err => {
wx.hideLoading()
wx.showToast({
title: '数据有误,请稍后重试',
icon: 'error',
success: () => {
wx.navigateBack()
}
})
})
},
//打开项目信息编辑页面
doBuy(e) {
//计算价格
const _self = this
var price = e.currentTarget.dataset.type == 'ALL' ? _self.data.allPrice : _self.data.materialPrice
var type = e.currentTarget.dataset.type
if (type == 'ALL' && _self.data.isUrgent) {
price += _self.data.urgent
}
wx.navigateTo({
url: '../createProjectInfo/createProjectInfo?type=' + e.currentTarget.dataset.type,
url: '../createProjectInfo/createProjectInfo?type=' + type + '&price=' + price + '&isUrgent=' + _self.data.isUrgent,
})
}
})

View File

@ -17,9 +17,9 @@
<view class="buy-all-title">
<view class="buy-all-txt">
<text class="txt">全托管</text>
<text class="money">¥280-1080</text>
<text class="money">¥{{allPrice/100}}-{{(allPrice+urgent)/100}}</text>
</view>
<view class="buy-all-btn" bind:tap="doBuy" data-type="all">购买</view>
<view class="buy-all-btn" bind:tap="doBuy" data-type="ALL">购买</view>
</view>
<view class="buy-desc-box mt-10">
<view class="buy-desc-txt">从下单到取证,仅需提供基本信息,我们为您提供一站式管家服务.</view>
@ -77,10 +77,11 @@
</view>
</view>
<view class="buy-desc-column box-bottom-options mt-20">
<checkbox class="custom-wx-checkbox">
<tex style="color: #532A00;padding-left: 10rpx;font-weight: 400;">加急办理800元</tex>
</checkbox>
<!-- <view class="txt"></view> -->
<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>
@ -88,8 +89,11 @@
<view class="buy-all-box">
<view class="pd-20">
<view class="buy-all-title">
<view class="buy-all-txt">写材料</view>
<view class="buy-all-btn" bind:tap="doBuy" data-type="material">购买</view>
<view class="buy-all-txt">
<text class="txt">写材料</text>
<text class="money">¥{{materialPrice/100}}</text>
</view>
<view class="buy-all-btn" bind:tap="doBuy" data-type="MATERIAL">购买</view>
</view>
<view class="buy-desc-box">
<view class="buy-desc-txt mt-10">通过平台自己搭建可运行软件后由平台自动生成相关鉴别材料,下载鉴别材料后可自行申报或找相关代理机构申报.</view>

View File

@ -1,20 +1,68 @@
import ProjectService from '../../../net/api/projectApi'
import UserService from '../../../net/api/userApi'
const utils = require("../../../utils/util")
const {
isValidPhone,
isValidEmail
} = require('../../../utils/validator')
Page({
data: {
items: ['项目 1', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 2', '项目 3', '项目 4', '项目 5', '项目 6', '项目 7', '项目 8', '项目 9', '项目 10'],
date: utils.formatDate(new Date()),
completeDate: utils.formatDate(new Date()), //开发完成时间
version: "v1.0", //系统版本
type: 'all', //默认全托管 上级页面传递type参数 all全托管 material写材料
languageList: ['JAVA', "PYTHON", "GO", "KOTLIN"],
type: 'ALL', //默认全托管 上级页面传递type参数 all全托管 material写材料
languageList: ['JAVA'],
isShowLanguage: false, //是否显示语言选择
isShowContact: false, //是否显示联系人
currentLanguage: 'JAVA', //当前选中的语言
price: 0,
packageList: [], //套餐包
couponsList: [], //优惠卷
contactList: [], //联系人
selectContact: {}, //当前选中的联系人
showCreateContact: false, //显示创建联系人
contactPhone: '', //联系人电话
contactName: '', //联系人姓名
contactEmail: '', //联系人邮箱
csaNo: '', //客服NO
showError: false,
errorHint: '',
showSuccess: false,
successHint: '',
showCommendProject: false, //显示推荐项目名称弹窗
projectName: '',
projectNameList: [],
isUrgent: false, //是否加急
},
onLoad(options) {
wx.setNavigationBarTitle({
title: '创建软著',
})
console.log(options)
const typeParams = options.type //类型
const priceParams = options.price //价格
const isUrgentParams = options.isUrgent
if (priceParams && priceParams > 0) {
this.setData({
price: priceParams,
type: typeParams,
isUrgent: isUrgentParams
})
} else {
wx.showToast({
title: '数据有误,请重试',
icon: 'error'
})
wx.navigateBack()
}
//获取项目联系人
this.doGetContactList()
//获取套餐包
this.doGetPackage()
//获取优惠卷
this.doGetCoupons()
//获取客服ID
this.doGetCsaNo(false)
},
//系统版本
inputVersion(e) {
@ -30,6 +78,11 @@ Page({
completeDate: e.detail.value
})
},
toggleContact() {
this.setData({
isShowContact: !this.data.isShowContact
})
},
toggleOptions() {
this.setData({
isShowLanguage: !this.data.isShowLanguage
@ -41,5 +94,259 @@ Page({
currentLanguage: selectedValue,
isShowLanguage: false
});
},
inputContactName(e) {
this.setData({
contactName: e.detail.value
})
},
inputContactPhone(e) {
console.log(e)
this.setData({
contactPhone: e.detail.value
})
},
inputContactEmail(e) {
this.setData({
contactEmail: e.detail.value
})
},
//监听项目名称
inputProjectName(e) {
this.setData({
projectName: e.detail.value
})
},
//选中联系人
doChangeContact(e) {
console.log(e)
this.setData({
selectContact: this.data.contactList[e.detail.value]
})
},
//获取产权联系人
doGetContactList() {
wx.showLoading({
title: '加载中...',
})
const _self = this
ProjectService.doGetContactList()
.then(res => {
wx.hideLoading()
console.log(res)
_self.setData({
contactList: res,
selectContact: res[0]
})
}, err => {
wx.hideLoading()
})
},
//获取套餐包
doGetPackage() {
ProjectService.doGetPackageList()
.then(res => {
}, err => {
})
},
//获取优惠卷
doGetCoupons() {
ProjectService.doGetCouponseList()
.then(res => {
}, err => {
})
},
//获取客服NO
doGetCsaNo(isShow) {
const _self = this
UserService.doGetCsaNo()
.then(res => {
console.log(res)
_self.setData({
csaNo: res.csaNo
})
if (isShow) {
_self.setData({
isShowContact: true
})
}
}, err => {
console.log(err)
})
},
//推荐项目名称
doCommendProjectName() {
const _self = this
_self.setData({
showCommendProject: true
})
},
//生成项目全称列表
doCreateFullName() {
const _self = this
wx.showLoading({
title: '生成中...',
})
const data = {
prompt: _self.data.projectName
}
ProjectService.doGetCommendProjectName(data)
.then(res => {
wx.hideLoading()
console.log(res)
if (res && res.length > 0) {
_self.setData({
projectNameList: res
})
} else {
_self.setData({
showError: true,
errorHint: '未查询到相关推荐的系统名称,请重新输入'
})
}
}, err => {
wx.hideLoading()
console.log(err)
})
},
//监听项目名称输入
inputCommendProjectName(e) {
const _self = this
_self.setData({
projectName: e.detail.value
})
},
//选择推荐的项目名称
doSelectProjectName(e) {
const _self = this
console.log(e)
_self.setData({
projectName: e.currentTarget.dataset.value,
showCommendProject: false,
projectNameList: []
})
},
//显示创建联系人
doCreateContact() {
const _self = this
if (_self.data.csaNo == '') {
_self.doGetCsaNo(true)
} else {
_self.setData({
showCreateContact: true
})
}
},
//保存联系人
doSaveContact() {
//校验参数
const _self = this
if (_self.data.contactName == '') {
_self.setData({
showError: true,
errorHint: '请输入联系人姓名'
})
return
}
if (_self.data.contactPhone == '' || !isValidPhone(_self.data.contactPhone)) {
_self.setData({
showError: true,
errorHint: '请输入合法的联系电话'
})
return
}
if (_self.data.contactEmail != '') {
if (!isValidEmail(_self.data.contactEmail)) {
_self.setData({
showError: true,
errorHint: '请输入合法的邮箱'
})
return
}
}
wx.showLoading({
title: '创建中...',
})
const data = {
"company": "",
"csaNo": _self.data.csaNo,
"name": _self.data.contactName,
"phone": _self.data.contactPhone
}
UserService.doCreateContact(data)
.then(res => {
wx.hideLoading()
_self.setData({
showSuccess: true,
successHint: '新建成功',
isShowContact: false,
contactEmail: '',
contactPhone: '',
contactName: ''
})
//获取一遍联系人
_self.doGetContactList()
}, err => {
wx.hideLoading()
_self.setData({
showError: true,
errorHint: err.msg ? err.msg : '新建失败,请稍后重试',
isShowContact: false
})
})
},
//创建项目
doCreateProject() {
//校验参数
const _self = this
const isLegal = _self.doCheckProjectParams()
if (isLegal) {
wx.showLoading({
title: '创建中...',
})
//构建参数
const data = {
applyContactCsaNo: _self.data.selectContact.csaNo, // 联系人客服编号
applyContactId: _self.data.selectContact.projContactId, //联系人ID
applyContactName: _self.data.selectContact.name, //联系人姓名
applyContactPhone: _self.data.selectContact.phone, //联系人手机
projDevCompleteDate: _self.data.completeDate, //开发完成日期
projSubName: _self.data.projectName, //项目简称
projVersion: _self.data.version, //项目版本
backendCodeLang: _self.data.currentLanguage,
projChargeType: 'ALL', //项目收费类型 ALL,FREE,MATERIAL,MATERIAL_AGENT,MATERIAL_AGENT_URGENT
}
ProjectService.doCreateProject(data)
.then(res => {
console.log(res)
wx.hideLoading()
}, err => {
wx.hideLoading()
console.log(err)
})
}
},
//校验参数
doCheckProjectParams() {
const _self = this
if (_self.data.projectName == '') {
_self.setData({
showError: true,
errorHint: '请输入项目名称'
})
return false
}
if (Object.keys(_self.data.selectContact).length <= 0) {
_self.setData({
showError: true,
errorHint: '请选择产权联系人'
})
return false
}
return true
}
})

View File

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

View File

@ -12,19 +12,21 @@
</swiper>
<view class="info-box">
<view class="info-title">项目信息</view>
<input class="info-value" placeholder="请输入系统全称(注:建议以'软件''平台''系统'等字眼结尾)" />
<view class="info-btn">推荐</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">
<view class="label">产权所属者</view>
<input class="desc" placeholder="请输入产权所属者" />
</view>
<view class="item">
<text class="label">产权联系人</text>
<input class="desc" placeholder="请选择/创建知识产权联系人" />
<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">
@ -70,4 +72,52 @@
</view>
</view>
</view>
</view>
<view class="bottom-box">
<view class="money">金额:
<text class="price">{{price/100}}元</text>
</view>
<view class="btn" bind:tap="doCreateProject">保存并付款</view>
</view>
</view>
<mp-half-screen-dialog show="{{showCreateContact}}">
<view slot="title">创建联系人</view>
<view slot="desc">
<view class="form-box">
<view class="form-item">
<view class="form-item-title">姓名</view>
<input vlaue="{{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" />
</view>
<view class="form-item">
<view class="form-item-title">联系邮箱</view>
<input value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" />
</view>
</view>
</view>
<view slot="footer">
<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">
<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>
</view>
<view slot="footer" style="height: 0px;">
<button type="primary" bind:tap="doCreateFullName">生成</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>

View File

@ -122,4 +122,79 @@
.option:hover {
background-color: #f0f0f0;
}
.bottom-box {
position: fixed;
left: 0;
bottom: 0;
text-align: center;
width: 94vw;
line-height: 100rpx;
border-radius: 20rpx;
margin: 20rpx;
background-color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.bottom-box .btn {
background-color: #37AD46;
color: white;
text-align: center;
height: 40px;
width: 94vw;
line-height: 40px;
border-radius: 20rpx;
margin-bottom: 20px;
}
.bottom-box .money {
color: #532A00;
font-size: 20px;
}
.price {
color: rgb(250, 0, 0);
}
.form-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
font-size: 14px;
width: 100vw;
}
.form-item {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 80vw;
padding: 10px;
}
.form-item-title {
flex: .3;
}
.form-item-content {
flex: 1;
}
.project-box {
display: flex;
flex-direction: column;
}
.project-item {
font-size: 18px;
background-color: #f5f5f5;
margin: 10px;
padding: 10px;
text-align: center;
}

View File

@ -1,29 +1,67 @@
// index.js
import ProjectService from '../../net/api/projectApi'
const app = getApp()
const deviceInfo = wx.getDeviceInfo()
const screenInfo = wx.getWindowInfo();
const statusBarHeight = screenInfo.statusBarHeight; // 状态栏高度
const navBarHeight = deviceInfo.platform == 'IOS' ? 48 : 50; // 导航栏高度iOS 为 44pxAndroid 为 48px
const windowHeight = screenInfo.windowHeight - navBarHeight - statusBarHeight; //可用内容高度
Page({
data: {
statusBarHeight: statusBarHeight,
navBarHeight: navBarHeight,
totalHeight: navBarHeight, // 导航栏总高度
contentHeight: windowHeight,
tabList: ["写材料", "全托管", "安装包", "演示视频", "加急", "提交版权中心", "已经下证"],
currentTypeTab: "写材料",
tagList: [],
currentTag: '',
typeList: [{
value: 'FREE',
label: '免费试用'
},
{
value: 'MATERIAL',
label: '写材料'
},
{
value: 'ALL',
label: '全托管'
},
],
currentType: '',
expandList: [{
value: 'PKG',
label: '安装包'
},
{
value: 'VIDEO_DEMO',
label: '演示视频'
},
{
value: 'URGENT',
label: '加急'
},
],
currentExpand: '',
currentStatus: 1, //默认状态 1进行 2完成
listLoading: 'loading', //loading 状态
listRefreshTrig: false, //是否正在刷新
pageData: {
page: 1,
rows: 10
},
projectList: [], //项目列表
noticeContent: ''
},
onLoad(e) {
const _self = this
setTimeout(() => {
_self.setData({
listLoading: 'success'
})
}, 1000);
//获取通知
_self.doGetNotice()
//获取标签选项
_self.doGetTagList()
//获取列表
_self.doChangeParams(1)
},
//创建项目
createCopy() {
@ -44,11 +82,64 @@ Page({
})
},
//切换类型
doChangeTypeTab(e) {
var _self = this
doChangeType(e) {
const _self = this
if (_self.data.currentType == e.currentTarget.dataset.value) {
_self.setData({
currentType: ''
})
} else {
_self.setData({
currentType: e.currentTarget.dataset.value
})
}
_self.doChangeParams(1)
},
//切换附加
doChangeExpand(e) {
const _self = this
if (_self.data.currentExpand == e.currentTarget.dataset.value) {
_self.setData({
currentExpand: ''
})
} else {
this.setData({
currentExpand: e.currentTarget.dataset.value
})
}
_self.doChangeParams(1)
},
//切换标签
doChangeTag(e) {
const _self = this
if (_self.data.currentTag == e.currentTarget.dataset.value) {
_self.setData({
currentTag: ''
})
} else {
_self.setData({
currentTag: e.currentTarget.dataset.value
})
}
_self.doChangeParams(1)
},
//构建参数
doChangeParams(page) {
const _self = this
_self.setData({
currentTypeTab: e.currentTarget.dataset.value
projectList: [],
'pageData.page': page
})
const [part1, part2] = _self.data.currentTag.split(':')
const params = {
page: _self.data.pageData.page,
rows: _self.data.pageData.rows,
tagNot: part2 ? part2 : '',
tagDataId: part1,
chargeType: _self.data.currentType,
chargeAdditionals: _self.data.currentExpand
}
_self.doGetSelfList(params)
},
//刷新列表
doRefreshList() {
@ -58,10 +149,54 @@ Page({
listRefreshTrig: true,
listLoading: 'loading'
})
setTimeout(() => {
_self.setData({
listRefreshTrig: false
_self.doChangeParams(1)
},
//获取通知
doGetNotice() {
const _self = this
ProjectService.doGetNotice()
.then(res => {
console.log(res)
_self.setData({
noticeContent: res.data
})
}, err => {
console.log(err)
})
},
//获取标签
doGetTagList() {
const _self = this
ProjectService.doGetTagList()
.then(res => {
_self.setData({
tagList: res
})
}, err => {
console.log(err)
})
},
//获取项目列表
doGetSelfList(params) {
const _self = this
_self.setData({
listLoading: 'loading'
})
ProjectService.doGetSelfProjectList(params)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.setData({
listLoading: status,
projectList: res.rows,
listRefreshTrig: false
})
}, err => {
_self.setData({
listLoading: 'error',
listRefreshTrig: false
})
})
}, 5000);
}
})

View File

@ -12,7 +12,9 @@
</view>
<view class="notice-box">
<view class="icon icon-horn-ind"></view>
<text class="txt">通知:你的软著已下证</text>
<view class="marquee-container">
<view class="marquee-text">{{noticeContent}}</view>
</view>
</view>
</view>
</view>
@ -28,9 +30,21 @@
</view>
<scroll-view scroll-x="{{true}}" class="mt-20">
<view class="list-tabs">
<block wx:for="{{tabList}}" wx:key="index">
<view class="{{currentTypeTab==item? 'tab-select' :'tab-normal'}} item-margin" bind:tap="doChangeTypeTab" data-value="{{item}}">
<text>{{item}}</text>
<block wx:for="{{typeList}}" wx:key="index">
<view class="{{currentType==item.value? 'tab-select' :'tab-normal'}} item-margin" bind:tap="doChangeType" data-value="{{item.value}}">
<text>{{item.label}}</text>
</view>
</block>
<view class="divider-h"></view>
<block wx:for="{{expandList}}" wx:key="index">
<view class="{{currentExpand==item.value? 'tab-select' :'tab-normal'}} item-margin" bind:tap="doChangeExpand" data-value="{{item.value}}">
<text>{{item.label}}</text>
</view>
</block>
<view class="divider-h"></view>
<block wx:for="{{tagList}}" wx:key="index">
<view class="{{currentTag==item.key? 'tab-select' :'tab-normal'}} item-margin" bind:tap="doChangeTag" data-value="{{item.key}}">
<text>{{item.value}}</text>
</view>
</block>
</view>
@ -40,28 +54,30 @@
<container-loading loadingState="{{listLoading}}" widgetHeight="{{contentHeight-240}}">
<scroll-view scroll-y="{{true}}" style="height: {{contentHeight-245}}px;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}">
<view class="list-content">
<view class="list-item">
<view class="item-img">
<image class="cover" src="https://img.ixintu.com/download/jpg/201911/e25b904bc42a74d7d77aed81e66d772c.jpg!con"></image>
<view class="item-img-status">
<text>生成成功</text>
<block wx:for="{{projectList}}" wx:key="index">
<view class="list-item">
<view class="item-img">
<image class="cover" src="https://img.ixintu.com/download/jpg/201911/e25b904bc42a74d7d77aed81e66d772c.jpg!con"></image>
<view class="item-img-status">
<text>生成成功</text>
</view>
</view>
<view class="item-content">
<view class="item-content-title">
<view class="project-name single-line">项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称</view>
<view class="project-status">7ssfsd</view>
</view>
<view class="project-aff">
<view class="icon icon-user-ind"></view>
<text class="txt">版权所属人</text>
</view>
<view class="project-btns">
<view class="project-create-time">2025-03-21 17:30:55</view>
<view class="project-btn">下载</view>
</view>
</view>
</view>
<view class="item-content">
<view class="item-content-title">
<view class="project-name single-line">项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称</view>
<view class="project-status">7ssfsd</view>
</view>
<view class="project-aff">
<view class="icon icon-user-ind"></view>
<text class="txt">版权所属人</text>
</view>
<view class="project-btns">
<view class="project-create-time">2025-03-21 17:30:55</view>
<view class="project-btn">下载</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</container-loading>

View File

@ -309,4 +309,29 @@
.project-btn:active {
background-color: #fe994479;
}
.marquee-container {
width: 100%;
overflow: hidden;
white-space: nowrap;
}
.marquee-text {
display: inline-block;
padding-left: 100%;
animation: marquee 10s linear infinite;
color: rgba(85, 0, 0, 1);
font-size: 14px;
margin-left: 15px;
}
@keyframes marquee {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-100%);
}
}

View File

@ -1,10 +1,6 @@
// pages/login/login.js
import UserService from '../../net/api/userApi';
const Cache = require('../../utils/storage');
import {
set,
get
} from '../../utils/storage';
Page({
/**
@ -16,7 +12,12 @@ Page({
code: '',
msg: '',
errno: '',
openId: ''
openId: '',
isShowHalfScreenDialog: false,
phone: '',
csaNo: '',
isAgree: false, //是否同意协议
contactName: '', //联系人姓名
},
/**
@ -49,7 +50,7 @@ Page({
wx.showToast({
title: '为了给您带来更便捷、个性化的服务,需要您提供手机号,完成注册流程,请点击授权登录',
icon: 'none',
duration: 2000
duration: 3000,
})
} else {
//保存token
@ -75,7 +76,7 @@ Page({
doShowExit() {
wx.showModal({
title: '提示',
content: '发生未知错误,请重新打开小程序',
content: '您未授权,请重新打开小程序,进行授权',
showCancel: false,
complete: (res) => {
if (res.confirm) {
@ -125,9 +126,18 @@ Page({
wx.hideLoading()
if (res.accessToken) {
Cache.set("token", res.accessToken);
wx.switchTab({
url: '/pages/index/index',
})
//创建所属人
if (res.phone && res.phone != '') {
_self.setData({
phone: res.phone
})
_self.doGetCsaNo()
} else {
//获取客服编号
wx.switchTab({
url: '/pages/index/index',
})
}
} else {
_self.doShowExit()
}
@ -143,15 +153,79 @@ Page({
_self.doShowExit()
}
},
doGetUserInfo() {
wx.getUserProfile({
desc: '获取昵称用于展示',
success: (res) => {
}
//获取客服编号
doGetCsaNo() {
const _self = this
wx.showLoading({
title: '加载中...',
})
UserService.doGetCsaNo()
.then(res => {
wx.hideLoading()
_self.setData({
csaNo: res.csaNo
})
_self.setData({
isShowHalfScreenDialog: true
})
}, err => {
wx.hideLoading()
_self.doShowExit()
console.log(err)
})
},
//联系人姓名
inputContact(e) {
this.setData({
contactName: e.detail.value
})
},
//创建版权所属人
doCreateOwn() {
//判断名称是否为空
const _self = this
if (_self.data.contactName == '') {
wx.showToast({
title: '请输入联系人姓名',
icon: 'error'
})
return
}
//去创建
const data = {
"company": "",
"csaNo": _self.data.csaNo,
"name": _self.data.contactName,
"phone": _self.data.phone
}
wx.showLoading({
title: '创建中...',
})
UserService.doCreateContact(data)
.then(res => {
wx.hideLoading()
wx.showToast({
title: '创建成功',
icon: 'success',
success: () => {
wx.switchTab({
url: '/pages/index/index',
})
}
})
}, err => {
wx.hideLoading()
_self.doShowExit()
})
},
//同意协议
doChangeAgree() {
this.setData({
isAgree: !this.data.isAgree
})
console.log(this.data.isAgree)
},
onUnload() {
console.log('login卸载')
}
},
})

View File

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

View File

@ -8,12 +8,24 @@
</view>
<view class="btn-content">
<view class="deal-box">
<checkbox></checkbox>
<checkbox-group bindchange="doChangeAgree">
<checkbox>
</checkbox>
</checkbox-group>
<text>阅读并同意</text>
<text class="deal" bind:tap="showServiceDeal">《用户服务协议》</text>
<text>和</text>
<text class="deal" bind:tap="showPrivacyDeal">《隐私条款》</text>
</view>
<button class="btn" open-type="getPhoneNumber" bindgetphonenumber="doGetPhoneNumber">授权登录</button>
<button class="btn" open-type="getPhoneNumber" bindgetphonenumber="doGetPhoneNumber" disabled="{{!isAgree}}">授权登录</button>
</view>
</view>
</view>
<mp-half-screen-dialog closabled="{{false}}" show="{{isShowHalfScreenDialog}}" maskClosable="{{false}}">
<view slot="title">创建联系人</view>
<view slot="desc">
<input placeholder="请输入联系人姓名" style="font-size: 16px;color: black;line-height: 20px;" bindinput="inputContact" value="{{contactName}}" />
</view>
<view slot="footer">
<button type="primary" class="weui-btn" bind:tap="doCreateOwn">创建</button>
</view>
</mp-half-screen-dialog>

View File

@ -90,4 +90,54 @@ wx-checkbox .wx-checkbox-input.wx-checkbox-input-checked:before {
100% {
transform: scale(1);
}
}
.weui-half-screen-dialog__container {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
}
.weui-half-screen-dialog {
background: #fff;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
overflow: hidden;
}
.weui-half-screen-dialog__hd {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
border-bottom: 1px solid #eee;
}
.weui-half-screen-dialog__title {
font-size: 18px;
font-weight: bold;
}
.weui-half-screen-dialog__close {
cursor: pointer;
}
.weui-half-screen-dialog__bd {
padding: 15px;
}
.custom-content text {
display: block;
margin-bottom: 10px;
}
.weui-half-screen-dialog__ft {
padding: 15px;
text-align: center;
}

View File

@ -5,5 +5,5 @@
"compileHotReLoad": true,
"urlCheck": false
},
"libVersion": "3.6.6"
"libVersion": "3.7.11"
}