diff --git a/app.json b/app.json index c572da2..87c6bd3 100644 --- a/app.json +++ b/app.json @@ -37,5 +37,8 @@ "lazyCodeLoading": "requiredComponents", "usingComponents": { "ad-popup": "./components/ad-popup/ad-popup" + }, + "useExtendedLib": { + "weui": true } } \ No newline at end of file diff --git a/app.wxss b/app.wxss index 9175b28..483aee3 100644 --- a/app.wxss +++ b/app.wxss @@ -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; diff --git a/components/container-loading/container-loading.wxml b/components/container-loading/container-loading.wxml index aa37c03..d337dea 100644 --- a/components/container-loading/container-loading.wxml +++ b/components/container-loading/container-loading.wxml @@ -4,6 +4,10 @@ 加载失败 + + + 暂无数据 + diff --git a/net/api/commonApi.js b/net/api/commonApi.js deleted file mode 100644 index 31f38b7..0000000 --- a/net/api/commonApi.js +++ /dev/null @@ -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; \ No newline at end of file diff --git a/net/api/domainApi.js b/net/api/domainApi.js deleted file mode 100644 index 03726c9..0000000 --- a/net/api/domainApi.js +++ /dev/null @@ -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; \ No newline at end of file diff --git a/net/api/indexApi.js b/net/api/indexApi.js deleted file mode 100644 index ac5d300..0000000 --- a/net/api/indexApi.js +++ /dev/null @@ -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; \ No newline at end of file diff --git a/net/api/policyApi.js b/net/api/policyApi.js deleted file mode 100644 index f884829..0000000 --- a/net/api/policyApi.js +++ /dev/null @@ -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; \ No newline at end of file diff --git a/net/api/projectApi.js b/net/api/projectApi.js new file mode 100644 index 0000000..c0b3123 --- /dev/null +++ b/net/api/projectApi.js @@ -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; \ No newline at end of file diff --git a/net/api/testapi.js b/net/api/testapi.js deleted file mode 100644 index 7b70902..0000000 --- a/net/api/testapi.js +++ /dev/null @@ -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){ -// // 错了干点啥? -// } -// } -// }) \ No newline at end of file diff --git a/net/api/userApi.js b/net/api/userApi.js index 4a05194..cc25151 100644 --- a/net/api/userApi.js +++ b/net/api/userApi.js @@ -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) } } diff --git a/net/http.js b/net/http.js index 8dac5f4..e206bd7 100644 --- a/net/http.js +++ b/net/http.js @@ -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 } \ No newline at end of file diff --git a/pages/copyright/createBuy/createBuy.js b/pages/copyright/createBuy/createBuy.js index 95cf604..38d870a 100644 --- a/pages/copyright/createBuy/createBuy.js +++ b/pages/copyright/createBuy/createBuy.js @@ -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, }) } }) \ No newline at end of file diff --git a/pages/copyright/createBuy/createBuy.wxml b/pages/copyright/createBuy/createBuy.wxml index ae1086d..d0d964a 100644 --- a/pages/copyright/createBuy/createBuy.wxml +++ b/pages/copyright/createBuy/createBuy.wxml @@ -17,9 +17,9 @@ 全托管 - ¥280-1080 + ¥{{allPrice/100}}-{{(allPrice+urgent)/100}} - 购买 + 购买 从下单到取证,仅需提供基本信息,我们为您提供一站式管家服务. @@ -77,10 +77,11 @@ - - 加急办理800元 - - + + + 加急办理{{urgent/100}}元 + + @@ -88,8 +89,11 @@ - 写材料 - 购买 + + 写材料 + ¥{{materialPrice/100}} + + 购买 通过平台自己搭建可运行软件后由平台自动生成相关鉴别材料,下载鉴别材料后可自行申报或找相关代理机构申报. diff --git a/pages/copyright/createProjectInfo/createProjectInfo.js b/pages/copyright/createProjectInfo/createProjectInfo.js index bcefadb..0cd11ed 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.js +++ b/pages/copyright/createProjectInfo/createProjectInfo.js @@ -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 } }) \ No newline at end of file diff --git a/pages/copyright/createProjectInfo/createProjectInfo.json b/pages/copyright/createProjectInfo/createProjectInfo.json index fc9d7fc..f51e08a 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.json +++ b/pages/copyright/createProjectInfo/createProjectInfo.json @@ -1,4 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog", + "mp-toptips": "weui-miniprogram/toptips/toptips" + } } \ No newline at end of file diff --git a/pages/copyright/createProjectInfo/createProjectInfo.wxml b/pages/copyright/createProjectInfo/createProjectInfo.wxml index 6751227..bdf2b1c 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.wxml +++ b/pages/copyright/createProjectInfo/createProjectInfo.wxml @@ -12,19 +12,21 @@ 项目信息 - - 推荐 + + 推荐 - - 产权所属者 - - 产权联系人 - + + + {{selectContact.name}} + + + + 新建 @@ -70,4 +72,52 @@ - \ No newline at end of file + + + 金额: + {{price/100}}元 + + 保存并付款 + + + + 创建联系人 + + + + 姓名 + + + + 联系电话 + + + + 联系邮箱 + + + + + + + + + + + 推荐系统全称 + + + + + + {{item}} + + + + + + + + + + \ No newline at end of file diff --git a/pages/copyright/createProjectInfo/createProjectInfo.wxss b/pages/copyright/createProjectInfo/createProjectInfo.wxss index 8f0daa3..bf13454 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.wxss +++ b/pages/copyright/createProjectInfo/createProjectInfo.wxss @@ -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; } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 675737c..cf21688 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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 为 44px,Android 为 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); } }) \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 53dc2ba..fccbc68 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -12,7 +12,9 @@ - 通知:你的软著已下证 + + {{noticeContent}} + @@ -28,9 +30,21 @@ - - - {{item}} + + + {{item.label}} + + + + + + {{item.label}} + + + + + + {{item.value}} @@ -40,28 +54,30 @@ - - - - - 生成成功 + + + + + + 生成成功 + + + + + 项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称 + 7ssfsd + + + + 版权所属人 + + + 2025-03-21 17:30:55 + 下载 + - - - 项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称项目名称 - 7ssfsd - - - - 版权所属人 - - - 2025-03-21 17:30:55 - 下载 - - - + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 6a6bb82..bc98fd3 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -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%); + } } \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index b8477c5..14bb4c7 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -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卸载') - } + }, }) \ No newline at end of file diff --git a/pages/login/login.json b/pages/login/login.json index 8835af0..1547c64 100644 --- a/pages/login/login.json +++ b/pages/login/login.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog" + } } \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 711e155..d22a067 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -8,12 +8,24 @@ - + + + + 阅读并同意 《用户服务协议》 《隐私条款》 - + - \ No newline at end of file + + + 创建联系人 + + + + + + + \ No newline at end of file diff --git a/pages/login/login.wxss b/pages/login/login.wxss index 9d98a23..fcb10f4 100644 --- a/pages/login/login.wxss +++ b/pages/login/login.wxss @@ -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; } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 03f55da..c3ca2e3 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -5,5 +5,5 @@ "compileHotReLoad": true, "urlCheck": false }, - "libVersion": "3.6.6" + "libVersion": "3.7.11" } \ No newline at end of file