From aa94413f670d62693c1d4fe80d394a84962941fb Mon Sep 17 00:00:00 2001
From: zdx <731335498@qq.com>
Date: Thu, 31 Dec 2020 13:15:31 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E4=BA=AB=E4=BA=8C?=
=?UTF-8?q?=E7=BB=B4=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apis/interfaces/user.js | 5 +
app.json | 1 +
.../company/projectRaise/projectRaise.wxml | 3 +-
pages/home/companyMore/companyMore.js | 6 +-
pages/ticket/index.wxss | 6 +-
pages/user/code/code.js | 172 +++++++++++
pages/user/code/code.json | 8 +
pages/user/code/code.wxml | 19 ++
pages/user/code/code.wxss | 73 +++++
pages/user/index.wxml | 5 +-
pages/user/setting/aboutUs/aboutUs.wxml | 3 +-
project.config.json | 266 +++++++++---------
12 files changed, 422 insertions(+), 145 deletions(-)
create mode 100644 pages/user/code/code.js
create mode 100644 pages/user/code/code.json
create mode 100644 pages/user/code/code.wxml
create mode 100644 pages/user/code/code.wxss
diff --git a/apis/interfaces/user.js b/apis/interfaces/user.js
index 39944ba..32b22c3 100644
--- a/apis/interfaces/user.js
+++ b/apis/interfaces/user.js
@@ -14,8 +14,13 @@ const companySubscribesList = ( page) => req({
page: page
}
})
+// 获取分享二维码
+const getShareCode = ( companyId) => req({
+ url: "user/share/"+companyId,
+})
export default({
userInfo,//用户基本信息
companySubscribesList,//关注企业列表
+ getShareCode,//获取分享二维码
})
diff --git a/app.json b/app.json
index 094bf25..e7f9f0c 100644
--- a/app.json
+++ b/app.json
@@ -18,6 +18,7 @@
"pages/user/user_coupon/user_coupon",
"pages/user/user_coupon_data/user_coupon_data",
"pages/user/setting/setting",
+ "pages/user/code/code",
"pages/user/setting/aboutUs/aboutUs",
"pages/user/setting/aboutMine/aboutMine",
"pages/user/setting/aboutAdvice/aboutAdvice",
diff --git a/components/company/projectRaise/projectRaise.wxml b/components/company/projectRaise/projectRaise.wxml
index 23830b8..f4ecc37 100644
--- a/components/company/projectRaise/projectRaise.wxml
+++ b/components/company/projectRaise/projectRaise.wxml
@@ -2,7 +2,7 @@
@@ -37,5 +37,4 @@
已结束
-
{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}
\ No newline at end of file
diff --git a/pages/home/companyMore/companyMore.js b/pages/home/companyMore/companyMore.js
index ddc61de..a256c6d 100644
--- a/pages/home/companyMore/companyMore.js
+++ b/pages/home/companyMore/companyMore.js
@@ -46,7 +46,7 @@ Page({
// 获取企业风采列表
graces() {
- wx.$api.companyModule.graces(this.data.company_id, this.data.page).then(res => {
+ wx.$api.companyModule.graces(wx.getStorageSync('company_id'), this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
@@ -65,7 +65,7 @@ Page({
},
// 获取企业宣传视频列表
videos() {
- wx.$api.companyModule.videos(this.data.company_id, this.data.page).then(res => {
+ wx.$api.companyModule.videos(wx.getStorageSync('company_id'), this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
@@ -84,7 +84,7 @@ Page({
},
// 获取企业员工页面
users() {
- wx.$api.companyModule.users(this.data.company_id, this.data.page).then(res => {
+ wx.$api.companyModule.users(wx.getStorageSync('company_id'), this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
diff --git a/pages/ticket/index.wxss b/pages/ticket/index.wxss
index 760309c..4182195 100644
--- a/pages/ticket/index.wxss
+++ b/pages/ticket/index.wxss
@@ -78,7 +78,7 @@ page{
}
.couponLabel text.active {
- background-color: #2151f5;
+ background-color: #378fff;
color: #fff;
}
@@ -128,7 +128,7 @@ page{
top: 0;
left: 0;
background-color: #c0d3fc;
- color: #2151f5;
+ color: #378fff;
z-index: 102;
font-size: 26rpx;
border-radius: 10rpx 0 10rpx 0;
@@ -215,7 +215,7 @@ page{
.couponEject-list-btn {
width: 140rpx;
- color: #2d6bf6;
+ color: #378fff;
background-color: #fff;
border-radius: 50rpx;
text-align: center;
diff --git a/pages/user/code/code.js b/pages/user/code/code.js
new file mode 100644
index 0000000..8848c37
--- /dev/null
+++ b/pages/user/code/code.js
@@ -0,0 +1,172 @@
+const style = {
+ codeContent: {
+ backgroundColor: 'white',
+ width: '375',
+ height: '525'
+ },
+ codeNickname: {
+ width: '355',
+ height: '46',
+ textAlign: 'center',
+ fontSize: '25',
+ verticalAlign: 'middle',
+ marginTop: '40',
+ marginLeft: '10'
+ },
+ codeJob: {
+ width: '355',
+ height: '30',
+ textAlign: 'center',
+ verticalAlign: 'middle',
+ fontSize: '15',
+ marginLeft: '10'
+ },
+ codeImg: {
+ width: '151',
+ height: '151',
+ marginTop: '30',
+ marginBottom: '40',
+ marginLeft: '112'
+ },
+ codeLogo: {
+ width: '51',
+ height: '51',
+ marginLeft: '162',
+ marginBottom: '5',
+ },
+ codeCompany: {
+ width: '355',
+ height: '30',
+ textAlign: 'center',
+ verticalAlign: 'middle',
+ fontSize: '15',
+ marginLeft: '10',
+ marginBottom: '20',
+ },
+ codeText: {
+ width: '355',
+ height: '30',
+ textAlign: 'center',
+ verticalAlign: 'middle',
+ fontSize: '13',
+ marginLeft: '10',
+ color: 'gray'
+ }
+}
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ code: "", //二维码
+ company: {}, //公司信息
+ user: {}, //用户信息,
+ name:'',//用户名
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ wx.getStorage({
+ key: 'compayId',
+ success: res => {
+ console.log(res);
+ wx.$api.user.getShareCode(res.data).then(res => {
+ this.setData({
+ user: {
+ job: res.job,
+ cover: res.cover,
+ name:options.name
+ },
+ company: {
+ name: res.company,
+ logo: res.logo,
+ id: res.company_id
+ },
+ code: res.code
+ })
+ })
+ }
+ })
+ },
+ /**
+ * 绘制分享海报
+ */
+ canvasDowImg() {
+ wx.showLoading({
+ title: "绘制海报中"
+ })
+ const wxml = `
+
+ ` + this.data.user.name + `
+
+
+ ` + this.data.company.name + `
+ 扫一扫,快速了解我们的企业
+
+ `
+ this.codeimg = this.selectComponent('.codeImg')
+ this.codeimg.renderToCanvas({
+ wxml,
+ style
+ }).then(() => {
+ this.codeimg.canvasToTempFilePath().then(res => {
+ console.log(res);
+
+ if (res.tempFilePath) {
+ wx.hideLoading()
+ this.dowQrCodeImg(res.tempFilePath)
+ } else {
+ wx.showToast({
+ title: "绘制失败,请稍后重试",
+ icon: "none"
+ })
+ }
+ })
+ })
+ },
+
+ /**
+ * 保存canvas图片到本地
+ */
+ dowQrCodeImg(path) {
+ wx.saveImageToPhotosAlbum({
+ filePath: path,
+ success: () => {
+ wx.showToast({
+ title: "保存成功,分享图已存储至您的手机相册",
+ icon: "none"
+ })
+ },
+ fail: () => {
+ wx.showModal({
+ title: "提示",
+ content: "由于您的设置,系统暂无权限访问您的相册,保存海报失败",
+ cancelText: "以后再说",
+ cancelColor: "#4f4f4f",
+ confirmText: "去设置",
+ confirmColor: "#0b0041",
+ success: res => {
+ if (res.confirm) {
+ wx.openSetting()
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+ return {
+ title: this.data.user.name + "邀请您快速了解" + this.data.company.name,
+ imageUrl: this.data.user.cover,
+ path: "/pages/employees/join/join?companyId=" + this.data.company.id
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/user/code/code.json b/pages/user/code/code.json
new file mode 100644
index 0000000..3c4c6ba
--- /dev/null
+++ b/pages/user/code/code.json
@@ -0,0 +1,8 @@
+{
+ "usingComponents": {
+ "wxml-to-canvas": "wxml-to-canvas"
+ },
+ "navigationBarTitleText" : "分享海报",
+ "navigationBarBackgroundColor" : "#378fff",
+ "navigationBarTextStyle" : "white"
+}
\ No newline at end of file
diff --git a/pages/user/code/code.wxml b/pages/user/code/code.wxml
new file mode 100644
index 0000000..b0adae3
--- /dev/null
+++ b/pages/user/code/code.wxml
@@ -0,0 +1,19 @@
+
+
+
+
+ {{user.name || "-"}}
+
+
+
+
+
+
+ {{company.name}}
+ 扫一扫,快速了解我们的企业
+
+
+
+
+
+
diff --git a/pages/user/code/code.wxss b/pages/user/code/code.wxss
new file mode 100644
index 0000000..7e117f3
--- /dev/null
+++ b/pages/user/code/code.wxss
@@ -0,0 +1,73 @@
+.codeImg{
+ position: fixed;
+ left: -100%;
+ top: -100%;
+}
+
+/* 展示图片 */
+.code-content{
+ margin: 30rpx;
+ padding: 60rpx 30rpx;
+ background: white;
+ border-radius: 10rpx;
+ box-shadow: 0 0 6rpx 6rpx rgba(0, 0, 0, .02);
+ text-align: center;
+}
+
+.code-nickname{
+ font-size: 50rpx;
+ padding-bottom: 20rpx;
+}
+
+.code-text{
+ border-top: dashed 1rpx #ddd;
+ padding-top: 30rpx;
+ color: gray;
+ margin-top: 60rpx;
+ font-size: 26rpx;
+}
+
+.code-img{
+ padding: 70rpx 0;
+}
+
+.code-img-src{
+ width: 300rpx;
+ height: 300rpx;
+ background: #eee;
+ vertical-align: top;
+}
+
+.code-logo-src{
+ background: #eee;
+ width: 98rpx;
+ height: 98rpx;
+}
+
+.code-company{
+ padding-top: 20rpx;
+}
+
+/* 操作按钮 */
+.code-btns{
+ padding: 0 15rpx 50rpx 15rpx;
+ display: flex;
+}
+
+.code-btn[size="default"]{
+ background: #ddd;
+ width: 100%;
+ line-height: 90rpx;
+ height: 90rpx;
+ padding: 0;
+ border-radius: 10rpx;
+ margin: 0 15rpx;
+ font-size: 32rpx;
+ color: white;
+ background: #ff8c37;
+}
+
+.code-btn[size="default"]:last-child{
+ background: #378fff;
+}
+
diff --git a/pages/user/index.wxml b/pages/user/index.wxml
index 73265df..57eb50b 100644
--- a/pages/user/index.wxml
+++ b/pages/user/index.wxml
@@ -36,12 +36,13 @@
我的订单
-
+
+
分享海报
-
+
diff --git a/pages/user/setting/aboutUs/aboutUs.wxml b/pages/user/setting/aboutUs/aboutUs.wxml
index f1a1ebe..9383f10 100644
--- a/pages/user/setting/aboutUs/aboutUs.wxml
+++ b/pages/user/setting/aboutUs/aboutUs.wxml
@@ -2,6 +2,5 @@
电子科技有限公司是一家集产品研发,生产及销售的大型高科技电子企业,是全球专业的液晶广告机,液晶电视及液晶拼接墙制造商,从创立伊始,历经多年的稳健发展,以推动国内液晶广告机的普及化为己任,以提升人类视听享受为目标,公司旗下品牌博视(TBOSV)已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
-
-电子科技有限公司是一家集产品研发,生产及销售的大型高科技电子企业,是全球专业的液晶广告机,液晶电视及液晶拼接墙制造商,从创立伊始,历经多年的稳健发展,以推动国内液晶广告机的普及化为己任,以提升人类视听享受为目标,公司旗下品牌博视(TBOSV)已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
+ 电子科技有限公司是一家集产品研发,生产及销售的大型高科技电子企业,是全球专业的液晶广告机,液晶电视及液晶拼接墙制造商,从创立伊始,历经多年的稳健发展,以推动国内液晶广告机的普及化为己任,以提升人类视听享受为目标,公司旗下品牌博视(TBOSV)已经成为全球普遍赞誉的知名品牌。上海域展电子科技有限公司成立于2006年。我们凭借着"以品质为根本、以创新求发展"的理念;力争以优质的全方位服务为客户提供具有竞争力价...
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
index 80a565a..80c856d 100644
--- a/project.config.json
+++ b/project.config.json
@@ -1,143 +1,143 @@
{
- "description": "项目配置文件",
- "packOptions": {
- "ignore": []
+ "description": "项目配置文件",
+ "packOptions": {
+ "ignore": []
+ },
+ "setting": {
+ "urlCheck": true,
+ "es6": true,
+ "enhance": false,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": true,
+ "coverView": true,
+ "nodeModules": true,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": false,
+ "useApiHook": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
},
- "setting": {
- "urlCheck": true,
- "es6": true,
- "enhance": false,
- "postcss": true,
- "preloadBackgroundData": false,
- "minified": true,
- "newFeature": true,
- "coverView": true,
- "nodeModules": true,
- "autoAudits": false,
- "showShadowRootInWxmlPanel": true,
- "scopeDataCheck": false,
- "uglifyFileName": false,
- "checkInvalidKey": true,
- "checkSiteMap": true,
- "uploadWithSourceMap": true,
- "compileHotReLoad": false,
- "useMultiFrameRuntime": false,
- "useApiHook": true,
- "babelSetting": {
- "ignore": [],
- "disablePlugins": [],
- "outputPath": ""
- },
- "enableEngineNative": false,
- "bundle": false,
- "useIsolateContext": true,
- "useCompilerModule": false,
- "userConfirmedUseCompilerModuleSwitch": false,
- "userConfirmedBundleSwitch": false,
- "packNpmManually": false,
- "packNpmRelationList": [],
- "minifyWXSS": true
+ "enableEngineNative": false,
+ "bundle": false,
+ "useIsolateContext": true,
+ "useCompilerModule": false,
+ "userConfirmedUseCompilerModuleSwitch": false,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true
+ },
+ "compileType": "miniprogram",
+ "libVersion": "2.13.2",
+ "appid": "wxd931d03dfe955254",
+ "projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas",
+ "debugOptions": {
+ "hidedInDevtools": []
+ },
+ "isGameTourist": false,
+ "simulatorType": "wechat",
+ "simulatorPluginLibVersion": {},
+ "condition": {
+ "plugin": {
+ "list": []
},
- "compileType": "miniprogram",
- "libVersion": "2.13.2",
- "appid": "wxd931d03dfe955254",
- "projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas",
- "debugOptions": {
- "hidedInDevtools": []
+ "game": {
+ "list": []
},
- "isGameTourist": false,
- "simulatorType": "wechat",
- "simulatorPluginLibVersion": {},
- "condition": {
- "plugin": {
- "list": []
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "name": "登录",
+ "pathName": "pages/login/login",
+ "query": "",
+ "scene": null
},
- "game": {
- "list": []
+ {
+ "name": "搜索",
+ "pathName": "pages/company/search/search",
+ "query": "",
+ "scene": null
},
- "gamePlugin": {
- "list": []
+ {
+ "name": "商城",
+ "pathName": "pages/mall/index",
+ "query": "",
+ "scene": null
},
- "miniprogram": {
- "list": [
- {
- "name": "登录",
- "pathName": "pages/login/login",
- "query": "",
- "scene": null
- },
- {
- "name": "搜索",
- "pathName": "pages/company/search/search",
- "query": "",
- "scene": null
- },
- {
- "name": "商城",
- "pathName": "pages/mall/index",
- "query": "",
- "scene": null
- },
- {
- "name": "pages/user/index",
- "pathName": "pages/user/index",
- "query": "",
- "scene": null
- },
- {
- "name": "pages/user/companyMine/companyOrder",
- "pathName": "pages/user/companyMine/companyOrder",
- "query": "orderid=20201229132338964625",
- "scene": null
- },
- {
- "name": "pages/user/companyMine/companyOrder",
- "pathName": "pages/user/companyMine/companyOrder",
- "query": "orderid=20201229132338964625",
- "scene": null
- },
- {
- "name": "pages/user/companyMine/projectDetail/projectDetail",
- "pathName": "pages/user/companyMine/projectDetail/projectDetail",
- "query": "orderid=20201229132338964625",
- "scene": null
- },
- {
- "name": "pages/user/companyMine/refundInfo/refundInfo",
- "pathName": "pages/user/companyMine/refundInfo/refundInfo",
- "query": "orderid=20201229132338964625",
- "scene": null
- },
- {
- "name": "pages/home/index",
- "pathName": "pages/home/index",
- "query": "orderid=20201229132338964625",
- "scene": null
- },
- {
- "name": "pages/user/setting/setting",
- "pathName": "pages/user/setting/setting",
- "query": "",
- "scene": null
- },
- {
- "name": "pages/user/setting/aboutMine/aboutMine",
- "pathName": "pages/user/setting/aboutMine/aboutMine",
- "query": "",
- "scene": null
- },
- {
- "name": "pages/user/setting/aboutAdvice/aboutAdvice",
- "pathName": "pages/user/setting/aboutAdvice/aboutAdvice",
- "query": "",
- "scene": null
- },
- {
- "name": "pages/user/setting/aboutUs/aboutUs",
- "pathName": "pages/user/setting/aboutUs/aboutUs",
- "scene": null
- }
- ]
+ {
+ "name": "pages/user/index",
+ "pathName": "pages/user/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/companyMine/companyOrder",
+ "pathName": "pages/user/companyMine/companyOrder",
+ "query": "orderid=20201229132338964625",
+ "scene": null
+ },
+ {
+ "name": "pages/user/companyMine/companyOrder",
+ "pathName": "pages/user/companyMine/companyOrder",
+ "query": "orderid=20201229132338964625",
+ "scene": null
+ },
+ {
+ "name": "pages/user/companyMine/projectDetail/projectDetail",
+ "pathName": "pages/user/companyMine/projectDetail/projectDetail",
+ "query": "orderid=20201229132338964625",
+ "scene": null
+ },
+ {
+ "name": "pages/user/companyMine/refundInfo/refundInfo",
+ "pathName": "pages/user/companyMine/refundInfo/refundInfo",
+ "query": "orderid=20201229132338964625",
+ "scene": null
+ },
+ {
+ "name": "pages/home/index",
+ "pathName": "pages/home/index",
+ "query": "orderid=20201229132338964625",
+ "scene": null
+ },
+ {
+ "name": "pages/user/setting/setting",
+ "pathName": "pages/user/setting/setting",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/setting/aboutMine/aboutMine",
+ "pathName": "pages/user/setting/aboutMine/aboutMine",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/setting/aboutAdvice/aboutAdvice",
+ "pathName": "pages/user/setting/aboutAdvice/aboutAdvice",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/user/setting/aboutUs/aboutUs",
+ "pathName": "pages/user/setting/aboutUs/aboutUs",
+ "scene": null
}
+ ]
}
+ }
}
\ No newline at end of file