diff --git a/app.json b/app.json
index 83e2937..b4ae20d 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,7 @@
{
"pages": [
"pages/index/index/index",
+ "pages/justTest/justTest",
"pages/goods/categoryList/categoryList",
"pages/cart/cart/cart",
"pages/cart/cart2/cart2",
@@ -85,16 +86,17 @@
"pages/video/index",
"pages/template/index",
"pages/store/index"
-
],
"subPackages": [{
"root": "packageA/",
"name":"pack1",
"pages": [
+ "pages/liveStream/liveStream",
"pages/prom_list/prom_list",
"pages/quan_list/quan_list",
- "pages/quan_pro/quan_pro"
+ "pages/quan_pro/quan_pro",
+ "pages/liveStreamDetails/liveStreamDetails"
],
"plugins": {
"live-player-plugin": {
diff --git a/packageA/images/index/tuangou-pic.jpg b/packageA/images/index/tuangou-pic.jpg
new file mode 100644
index 0000000..36eee5d
--- /dev/null
+++ b/packageA/images/index/tuangou-pic.jpg
diff --git a/packageA/images/liveStreamDetails/circle.jpg b/packageA/images/liveStreamDetails/circle.jpg
new file mode 100644
index 0000000..03ac38f
--- /dev/null
+++ b/packageA/images/liveStreamDetails/circle.jpg
diff --git a/packageA/images/liveStreamDetails/cover.jpg b/packageA/images/liveStreamDetails/cover.jpg
new file mode 100644
index 0000000..7514369
--- /dev/null
+++ b/packageA/images/liveStreamDetails/cover.jpg
diff --git a/packageA/images/liveStreamDetails/friend.jpg b/packageA/images/liveStreamDetails/friend.jpg
new file mode 100644
index 0000000..2cc79d3
--- /dev/null
+++ b/packageA/images/liveStreamDetails/friend.jpg
diff --git a/packageA/images/liveStreamDetails/goods.jpg b/packageA/images/liveStreamDetails/goods.jpg
new file mode 100644
index 0000000..5cf5ab5
--- /dev/null
+++ b/packageA/images/liveStreamDetails/goods.jpg
diff --git a/packageA/images/liveStreamDetails/home.jpg b/packageA/images/liveStreamDetails/home.jpg
new file mode 100644
index 0000000..172dac0
--- /dev/null
+++ b/packageA/images/liveStreamDetails/home.jpg
diff --git a/packageA/images/liveStreamDetails/playbill.jpg b/packageA/images/liveStreamDetails/playbill.jpg
new file mode 100644
index 0000000..3fe65e7
--- /dev/null
+++ b/packageA/images/liveStreamDetails/playbill.jpg
diff --git a/packageA/images/liveStreamDetails/save.jpg b/packageA/images/liveStreamDetails/save.jpg
new file mode 100644
index 0000000..562f648
--- /dev/null
+++ b/packageA/images/liveStreamDetails/save.jpg
diff --git a/packageA/images/liveStreamDetails/share.jpg b/packageA/images/liveStreamDetails/share.jpg
new file mode 100644
index 0000000..c1b29c7
--- /dev/null
+++ b/packageA/images/liveStreamDetails/share.jpg
diff --git a/packageA/pages/liveStream/liveStream.js b/packageA/pages/liveStream/liveStream.js
new file mode 100644
index 0000000..471f96b
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.js
@@ -0,0 +1,138 @@
+// pages/liveStream/liveStream.js
+
+var t = require("../../../utils/util"),
+ ut = t,
+ e = require("../../../utils/common.js"),
+ a = require("../../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+var utils = require('../../../utils/util.js'),ut=utils;
+var regeneratorRuntime = require('../../../utils/runtime.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ goodsList: [],
+ imghost: '',
+ liveList: {}
+ },
+
+ // 点击直播列表项
+ clickItem: function (e) {
+ // id:列表项id
+ // live:直播类别 即将开始/直播中/精彩回放
+ wx.navigateTo({
+ url: '/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + e.currentTarget.dataset.id + '&live=' + e.currentTarget.dataset.live
+ })
+ console.log('options-->');
+ },
+
+ // 点击 订阅/观看直播/观看回放 按钮,跳转直播组件
+ clickLive: function (e) {
+ console.log('当前房间号roomid:',e.currentTarget.dataset.roomid);
+ let roomId = e.currentTarget.dataset.roomid;
+ let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 }));
+ wx.navigateTo({
+ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${customParams}`
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var live = {};
+ live.toBegin = []; // 即将开始
+ live.ing = []; // 直播中
+ live.over = []; // 已结束
+
+ // 请求数据
+ var that = this;
+ getApp().request.promiseGet("/api/weshop/wx/livelist/page", {}).then(res=>{
+ console.log('ressss--->',res);
+ if(res.data.code==0){
+ that.setData({
+ goodsList: res.data.data.pageData
+ })
+ }
+ // console.log(goodsList);
+
+ var result = res.data.data.pageData;
+ var liveStatus;
+ if(res.data.code == 0) {
+ for(var i in result) {
+ console.log(i + '当前直播状态:', result[i].live_status);
+ liveStatus = result[i].live_status;
+ // 这里只显示101/102/103状态
+ if (liveStatus == '101') {
+ live.ing.push(result[i]);
+ } else if (liveStatus == '102') {
+ live.toBegin.push(result[i]);
+ } else if (liveStatus == '103') {
+ live.over.push(result[i]);
+ }
+ }
+ // console.log('live--->', live);
+ that.setData({
+ live
+ });
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.json b/packageA/pages/liveStream/liveStream.json
new file mode 100644
index 0000000..b111cb3
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "subscribe": "plugin-private://wx2b03c6e691cd7370/components/subscribe/subscribe"
+ }
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.wxml b/packageA/pages/liveStream/liveStream.wxml
new file mode 100644
index 0000000..ee02d20
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.wxml
@@ -0,0 +1,66 @@
+
+
+
+ 当前暂无直播
+
+
+ 即将开始
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 直播中
+
+
+
+
+
+
+
+ {{item.name}}
+ 观看直播
+
+
+
+
+
+
+
+
+
+ 精彩回放
+
+
+
+
+
+
+
+ {{item.name}}
+ 观看回放
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.wxss b/packageA/pages/liveStream/liveStream.wxss
new file mode 100644
index 0000000..ab33fc0
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.wxss
@@ -0,0 +1,95 @@
+/* pages/liveStream/liveStream.wxss */
+.title {
+ font-size: 30rpx;
+ padding: 50rpx 32rpx;
+}
+.list-item {
+ padding: 0 32rpx 30rpx;
+ display: flex;
+}
+.list-item-left {
+ position: relative;
+ width: 300rpx;
+ height: 300rpx;
+ flex-shrink: 0;
+}
+.list-item-right {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding-left: 32rpx;
+ /* position: relative;
+ padding-bottom: 70rpx; */
+}
+.item-pic {
+ /* width: 400rpx; */
+ width: 100%;
+ height: 100%;
+ background-color: #eee;
+}
+.item-desc {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ background: black;
+ color: #fff;
+ text-align: center;
+ padding-bottom: 23rpx;
+
+ background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/
+ background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/
+ background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/
+ background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/
+}
+.item-desc view:first-child {
+ font-size: 24rpx;
+ font-weight: bold;
+}
+.item-desc view:last-child {
+ font-size: 17rpx;
+}
+.item-title {
+ font-weight: bold;
+ font-size: 30rpx;
+ text-align: justify;
+
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 4;
+ overflow: hidden;
+}
+
+.item-btn {
+ width: 172rpx;
+ height: 56rpx;
+ line-height: 56rpx;
+ background-color: #000;
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+}
+subscribe {
+ position: relative;
+}
+.subscribe--live-player-subscribe__btn {
+ width: 172rpx !important;
+ height: 56rpx !important;
+ line-height: 56rpx !important;
+ background-color: #000 !important;
+ font-size: 28rpx !important;
+ position: relative;
+ border-radius: 0 !important;
+ margin: 0 !important;
+}
+.subscribe--live-player-notSubscribe::before {
+ content: '订阅';
+ position: absolute;
+ left: 0;
+ width: 172rpx;
+ height: 56rpx;
+ background-color: #000;
+ color: #fff;
+}
+.subscribe--live-player-hasSubscribe {
+ background-color: #666 !important;
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js
new file mode 100644
index 0000000..cfc2011
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js
@@ -0,0 +1,502 @@
+// pages/liveStreamDetails/liveStreamDetails.js
+var t = require("../../../utils/util.js"),
+ ut = t,
+ e = require("../../../utils/common.js"),
+ a = require("../../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+
+const app = getApp();
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ details: {},
+ status: '',
+ btnText: '',
+ showActionSheet: true,
+ showPlaybill: true,
+ windowWidth: 0,
+ windowHeight: 0,
+ dpr: 0,
+ canvasScale: 1.0,
+ nickName: '',
+ avatarUrl: '',
+ coverImg: '',
+ canvasToImgPath: ''
+ },
+
+ // 点击商品
+ clickgoods: function (e) {
+ console.log('...........>', e.currentTarget.dataset.url);
+ wx.navigateTo({
+ url: '../../../' + e.currentTarget.dataset.url
+ });
+ },
+
+ // 返回首页
+ backHome: function () {
+ wx.reLaunch({
+ url: '../../../pages/index/index/index',
+ })
+ },
+
+ // 分享操作表
+ clickShare: function () {
+ this.setData({
+ showActionSheet: !this.data.showActionSheet
+ })
+ },
+
+ // actionSheet - 取消按钮
+ hiddenActionSheet: function () {
+ this.setData({
+ showActionSheet: 'false'
+ })
+ },
+
+ //生成海报
+ createPlaybill: function () {
+ // 1.提示 “正在生成海报...”
+ wx.showLoading({
+ title: '正在生成海报...'
+ });
+ // 2.生成海报,如果生成完毕,关闭提示
+ this.drawPlaybill();
+ // 3.展示生成的海报
+ this.setData({
+ showPlaybill: !this.data.showPlaybill,
+ showActionSheet: 'false'
+ });
+ },
+
+ // 获取设备信息
+ getSystemInfo: function() {
+ let that = this;
+ wx.getSystemInfo({
+ success: function(res) {
+ that.setData({
+ windowWidth: res.windowWidth,
+ windowHeight: res.windowHeight,
+ dpr: res.pixelRatio
+ })
+ }
+ });
+ },
+
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
+ var lineWidth = 0;
+ var lastSubStrIndex = 0; //每次开始截取的字符串的索引
+ var han = 0;
+ for (let i = 0; i < str.length; i++) {
+ if (han == 2) return;
+ //lineWidth += ctx.measureText(str[i]).width;
+ lineWidth += ut.measureText(str[i], 21.3 * unit);
+ if (lineWidth > canvasWidth) {
+ han++;
+
+ if (han == 2) {
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
+ } else {
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
+ }
+ initHeight += 22; //22为字体的高度
+ lineWidth = 0;
+ lastSubStrIndex = i;
+ titleHeight += 20;
+ }
+ if (i == str.length - 1) { //绘制剩余部分
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
+ }
+ }
+ },
+
+ // 生成海报
+ drawPlaybill: function () {
+ var that = this
+ // 适配屏get幕
+ let scale = this.data.windowWidth / 375.0
+
+ this.setData({ totalHeight: 667*scale})
+ // 获取Canvas
+ let ctx = wx.createCanvasContext('myCanvas')
+
+ // 放大 因为不放大的话,生成的分享图会模糊。暂时先注释
+ ctx.scale(this.data.canvasScale, this.data.canvasScale)
+
+ // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ // os.stoid;
+
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ + "?sceneValue=1012" + "&pageValue=packageA/pages/liveStreamDetails/liveStreamDetails"
+ // console.log('path3---->', path3);
+
+
+ // 绘制主背景白色
+ ctx.setFillStyle('#ffffff')
+ ctx.fillRect(0, 0, this.data.windowWidth, this.data.totalHeight)
+ ctx.draw(true);
+
+
+ const coverImag = this.data.details['cover_img'];
+ const title = this.data.details.name;
+ console.log('detail--->', this.data.details);
+
+
+ //绘制头像
+ wx.getImageInfo({
+ src: that.data.avatarUrl,
+ success: function(res) {
+ ctx.save();
+ ctx.beginPath();
+ ctx.arc(29*scale, 27*scale, 14*scale, 0, 2*Math.PI);
+ ctx.clip();
+ ctx.drawImage(res.path, 15*scale, 13*scale, 28*scale, 28*scale);
+ ctx.restore()
+ ctx.draw(true);
+ }
+ })
+
+ // 绘制昵称
+ ctx.setFontSize(12*scale);
+ ctx.setFillStyle('#ADADAD');
+ ctx.fillText(this.data.nickName, 54*scale, 32*scale);
+
+ //绘制主图
+ wx.getImageInfo({
+ src: coverImag,
+ success: function(res) {
+ ctx.drawImage(res.path, 0, 52*scale, 240*scale, 191*scale);
+ ctx.draw(true);
+ }
+ })
+
+ //绘制文字
+ ctx.setFontSize(14*scale);
+ ctx.setFillStyle('#1E1E1E');
+ // ctx.fillText(title, 10*scale, 281*scale, 97*scale);
+ this.drawText(ctx, title, 10*scale, 281*scale, 130*scale, 130*scale, scale);
+ // ctx.draw(true);
+
+ //绘制小程序码
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale);
+ ctx.draw(true);
+ }
+ })
+
+ //绘制文字:常按识别
+ ctx.setFontSize(14*scale);
+ ctx.setFillStyle('#1E1E1E');
+ ctx.fillText('长按识别小程序', 135*scale, 350*scale);
+
+
+ //把画板内容绘制成图片,并回调 画板图片路径
+ ctx.draw(true, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ destWidth: that.data.windowWidth*2,
+ destHeight: that.data.windowHeight*2,
+ fileType: 'jpg',
+ quality: 1,
+ canvasId: 'myCanvas',
+ success: function(res) {
+ wx.hideLoading();
+ that.setData({
+ canvasToImgPath: res.tempFilePath,
+ });
+ console.log(res.tempFilePath);
+ }
+ })
+ }, 3000)
+ });
+ },
+
+
+
+ //点击观看直播
+ clickBtn: function () {
+ let roomId = this.data.details.roomid;
+ // let customPearams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 }));
+ wx.navigateTo({
+ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}`
+ })
+ },
+
+ // 保存图片到手机
+ onSaveToPhone() {
+ // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
+ this.getSetting().then((res) => {
+ // 判断用户是否授权了保存到相册的权限,如果没有发起授权
+ if (!res.authSetting['scope.writePhotosAlbum']) {
+ this.authorize().then(() => {
+ // 同意授权后保存下载文件
+ this.savedownloadFile(this.data.canvasToImgPath)
+ })
+ } else {
+ // 如果已经授权,保存下载文件
+ this.savedownloadFile(this.data.canvasToImgPath)
+ }
+ })
+ },
+
+ //打开设置,引导用户授权
+ onOpenSetting() {
+ wx.openSetting({
+ success:(res) => {
+ console.log(res.authSetting)
+ }
+ })
+ },
+
+ // 获取用户已经授予了哪些权限
+ getSetting() {
+ return new Promise((resolve, reject) => {
+ wx.getSetting({
+ success: res => {
+ console.log('getting---->', res);
+ resolve(res)
+ }
+ })
+ })
+ },
+
+ // 发起首次授权请求
+ authorize() {
+ // isFirst 用来记录是否为首次发起授权,
+ // 如果首次授权拒绝后,isFirst赋值为1
+ let isFirst = wx.getStorageSync('isFirst') || 0;
+ return new Promise((resolve, reject) => {
+ wx.authorize({
+ scope: 'scope.writePhotosAlbum',
+ // 同意授权
+ success: () => {
+ resolve()
+ },
+ // 拒绝授权,这里是用户拒绝授权后的回调
+ fail: res => {
+ if(isFirst === 0) {
+ wx.setStorageSync('isFirst', 1);
+ wx.showToast({
+ title: '保存失败',
+ icon: 'none',
+ duration: 1000
+ })
+ } else {
+ this.showModal()
+ }
+ console.log('拒绝授权');
+ reject()
+ }
+ })
+ })
+ },
+
+ //保存下载文件
+ savedownloadFile(img) {
+ this.downLoadFile(img).then((res) => {
+ return this.saveImageToPhotosAlbum(res.tempFilePath)
+ }).then(() => {
+ })
+ },
+
+ //单文件下载(下载文件资源到本地),客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径。
+ downLoadFile(img) {
+ return new Promise((resolve, reject) => {
+ wx.showLoading({
+ title: '保存中...',
+ mask: true,
+ });
+ wx.downloadFile({
+ url: img,
+ success: (res) => {
+ console.log('downloadfile', res)
+ resolve(res)
+ }
+ })
+ })
+ },
+
+ // 保存图片到系统相册
+ saveImageToPhotosAlbum(saveUrl) {
+ var self = this;
+ return new Promise((resolve, reject) => {
+ wx.saveImageToPhotosAlbum({
+ filePath: saveUrl,
+ success: (res) => {
+ wx.showToast({
+ title: '保存成功',
+ duration: 1000,
+ });
+ self.setData({
+ showPlaybill: 'true'
+ });
+ resolve()
+ }
+ })
+ })
+ },
+
+
+ // 弹出模态框提示用户是否要去设置页授权
+ showModal() {
+ wx.showModal({
+ title: '检测到您没有打开保存到相册的权限,是否前往设置打开?',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ this.onOpenSetting() // 打开设置页面
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this;
+ this.getSystemInfo();
+
+ getApp().request.promiseGet("/api/weshop/wx/livelist/get",{
+ data:{ id: options.id }
+ }).then(res=>{
+ if(res.data.code==0){
+ var obj = res.data.data;
+ var goods = JSON.parse(obj.goods);
+ obj.goods = goods;
+ that.setData({
+ details: obj
+ })
+ }
+ })
+
+ switch(options.live) {
+ case 'toBegin': {
+ this.setData({
+ btnText: '订阅'
+ })
+ break;
+ }
+ case 'ing': {
+ this.setData({
+ btnText: '进入直播间'
+ })
+ break;
+ }
+ default: {
+ this.setData({
+ btnText: '回放直播'
+ })
+ break;
+ }
+ }
+
+ this.setData({
+ nickName: app.globalData.userInfo.nickname,
+ avatarUrl: app.globalData.userInfo.head_pic
+ })
+
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ // ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale);
+ // ctx.draw(true);
+ that.setData({
+ ewm: res.path
+ })
+ }
+ })
+ },
+
+ // 获取图片信息
+ getImageInfo(src) {
+ return new Promise((resolve, reject) => {
+ wx.getImageInfo({
+ src: src,
+ success: (res) => {
+ resolve(res);
+ }
+ })
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ this.setData({
+ showActionSheet: 'false'
+ })
+ var self = this;
+ return {
+ title: this.data.details.name,
+ success: function(res) {
+ console.log('res---->', res);
+ },
+ complete: function(res) {
+ console.log('comple', res)
+ }
+ }
+ }
+})
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.json b/packageA/pages/liveStreamDetails/liveStreamDetails.json
new file mode 100644
index 0000000..cbe9a20
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "subscribe": "plugin-private://wx2b03c6e691cd7370/components/subscribe/subscribe"
+ }
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml
new file mode 100644
index 0000000..71c485e
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss
new file mode 100644
index 0000000..2b915c5
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss
@@ -0,0 +1,17 @@
+/*
+此文件为开发者工具生成,生成时间: 2020/7/4 下午3:58:01
+使用方法:参考 "packageA\pages\liveStreamDetails\liveStreamDetails.skeleton.wxml"
+*/
+.sk-transparent {
+ color: transparent !important;
+ }
+.sk-container {
+ position: absolute;
+ overflow: hidden;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1000000;
+ background-color: transparent;
+ }
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.wxml b/packageA/pages/liveStreamDetails/liveStreamDetails.wxml
new file mode 100644
index 0000000..59a390f
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.wxml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{details.name}}
+ {{myUtils.liveStatus(details.live_status)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{item.price}}
+
+
+
+
+
+
+
+
+
+ {{btnText}}
+
+
+
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+ 生成分享海报
+
+
+ 取消
+
+
+
+
+
+
+
+ 保存至相册
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.wxss b/packageA/pages/liveStreamDetails/liveStreamDetails.wxss
new file mode 100644
index 0000000..d54cbec
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.wxss
@@ -0,0 +1,247 @@
+/* pages/liveStreamDetails/liveStreamDetails.wxss */
+.active {
+ background-color: #ddd;
+}
+
+.content {
+ background-color: white;
+ padding-bottom: 168rpx;
+}
+.cover-container {
+ height: 646rpx;
+ position: relative;
+}
+.cover-img {
+ width: 100%;
+ height: 100%;
+}
+.cover-desc {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ text-align: center;
+ padding-top: 64rpx;
+ padding-bottom: 64rpx;
+ color: #fff;
+
+ background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/
+ background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/
+ background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/
+ background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/
+}
+.cover-desc view:first-child {
+ font-size: 50rpx;
+}
+.cover-desc view:last-child {
+ font-size: 42rpx;
+}
+
+.desc-container {
+ padding: 56rpx 46rpx 41rpx;
+ color: #3E3E3E;
+}
+.desc-title {
+ font-size: 42rpx;
+ font-weight: bold;
+}
+.desc-status {
+ display: inline-block;
+ color: #5B5B5B;
+ font-size: 28rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ padding: 0 30rpx;
+ background-color: #eee;
+ margin-top: 22rpx;
+ margin-bottom: 44rpx;
+}
+.desc-content {
+ font-size: 29rpx;
+}
+.list {
+ padding: 0 36rpx;
+}
+.list-item {
+ display: flex;
+ padding-bottom: 34rpx;
+}
+.list-item:not(:first-child) {
+ padding-top: 34rpx;
+}
+.list-item:not(:last-child) {
+ border-bottom: 2rpx solid #B5B5B5;
+}
+.item-pic {
+ width: 224rpx;
+ height: 224rpx;
+ border: 2rpx solid #E1E1E1;
+}
+.item-desc-container {
+ padding-left: 46rpx;
+ font-size: 24rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+.item-desc view:first-child {
+ padding-top: 10rpx;
+ padding-bottom: 38rpx;
+}
+.item-price:before {
+ content: '¥';
+}
+
+.share-container {
+ /* width: 86rpx; */
+ position: fixed;
+ padding: 0 8rpx;
+ box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.1);
+ right: 28rpx;
+ top: 50%;
+ background-color: #fff;
+}
+.share-container image {
+ display: block;
+ width: 60rpx;
+ height: 60rpx;
+ padding-top: 14rpx;
+ padding-bottom: 11rpx;
+}
+.share-container image:first-child {
+ border-bottom: 2rpx solid #E7E7E7;
+}
+
+
+.btn-container {
+ background-color: #fff;
+ box-sizing: border-box;
+ padding: 24rpx 128rpx;
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ box-shadow: 0px -1px 4px 1px rgba(0,0,0,0.1);
+}
+.btn {
+ color: #fff;
+ background-color: #000;
+ font-size: 36rpx;
+ line-height: 120rpx;
+ text-align: center;
+ /* width: 618rpx;
+ height: 92rpx; */
+}
+.subscribe--live-player-notSubscribe {
+ position: relative;
+}
+.subscribe--live-player-notSubscribe::before {
+ content: '订阅';
+ position: absolute;
+ left: 0;
+ width: 100%;
+ height: auto;
+ background-color: #000;
+ color: #fff;
+}
+.subscribe--live-player-subscribe__btn {
+ width: 100% !important;
+ height: auto !important;
+ font-size: 36rpx !important;
+ line-height: 120rpx !important;
+ border-radius: 0 !important;
+ background-color: #000 !important;
+}
+.subscribe--live-player-hasSubscribe {
+ background-color: #666 !important;
+}
+
+.share-actionSheet {
+ background-color: white;
+ padding-top: 45rpx;
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ z-index: 2;
+}
+.share-actionSheet-title {
+ font-size: 38rpx;
+
+}
+.share-actionSheet-list {
+ display: flex;
+ justify-content: space-around;
+ padding-bottom: 30rpx;
+}
+.share-actionSheet-item {
+ text-align: center;
+ padding: 20rpx;
+}
+.share-actionSheet-pic {
+ display: block;
+ width: 118rpx;
+ height: 118rpx;
+ border-radius: 50%;
+ margin: 0 auto;
+}
+.share-actionSheet-desc {
+ font-size: 28rpx;
+}
+
+.share-actionSheet-title,
+.share-actionSheet-cancle {
+ text-align: center;
+}
+
+.share-actionSheet-cancle {
+ padding: 30rpx 0;
+ border-top: 2rpx solid #CBCBCB;
+}
+
+.mask {
+ display: none;
+ background-color: rgba(0,0,0,.7);
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+.playbill {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 9999;
+ background: none;
+}
+.share-actionSheet.active ~ .mask,
+.playbill.active ~ .mask {
+ display: block;
+}
+
+.playbill-pic {
+ width: 478rpx;
+ height: 737rpx;
+ border-width: 31rpx 20rpx 51rpx;
+ border-color: black;
+ border-style: solid;
+ margin: 0 auto 26rpx;
+}
+
+.playbill-save {
+ width: 560rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ background-color: black;
+ color: #fff;
+ font-size: 36rpx;
+ text-align: center;
+}
+.playbill-save image {
+ width: 44rpx;
+ height: 36rpx;
+ margin-right: 23rpx;
+}
+
+button::after {
+ border: none;
+}
\ No newline at end of file
diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js
index 450ce8e..dedca4d 100644
--- a/packageA/pages/prom_list/prom_list.js
+++ b/packageA/pages/prom_list/prom_list.js
@@ -12,6 +12,7 @@ var utils = require('../../../utils/util.js'),ut=utils;
var regeneratorRuntime = require('../../../utils/runtime.js');
+
Page({
data: {
gid: "",
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 438b827..639b954 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -3219,17 +3219,17 @@ Page({
//--定义的保存图片方法,分享团---
saveImageToPhotosAlbum: function() {
//--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- //getApp().my_warnning("请先登录",0,this);
- wx.navigateTo({ url: '/pages/getphone/getphone', })
- return false;
- }
+ // var user_info = getApp().globalData.userInfo;
+ // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ // //getApp().my_warnning("请先登录",0,this);
+ // wx.navigateTo({ url: '/pages/getphone/getphone', })
+ // return false;
+ // }
//类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
- var type = this.data.prom_type;
- if (type == 6) type = 2;
- if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
+ // var type = this.data.prom_type;
+ // if (type == 6) type = 2;
+ // if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
wx.showLoading({
title: '生成中...',
@@ -3254,7 +3254,7 @@ Page({
var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
- console.log(path3);
+ console.log('xiaochengxu----->',path3);
//读取文件成功则OK--
wx.getImageInfo({
@@ -3284,155 +3284,164 @@ Page({
//文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
context.setFillStyle("black");
context.setFontSize(21.3 * unit)
- th.draw_Text(context, th.data.data.goods_name,
- 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
+ th.draw_Text(context, th.data.data.goods_name, 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
//------产品的价格-------
- context.setFontSize(23 * unit)
- context.setFillStyle("red")
- context.fillText("¥", 416 * unit, 185 * unit);
- context.setFontSize(31 * unit)
- var pri0 = th.data.data.shop_price;
- if (th.data.prom_act)
- pri0 = th.data.prom_act.price;
-
- pri0 = parseFloat(pri0).toFixed(2);
- context.fillText(pri0, 438 * unit, 185 * unit);
+ // context.setFontSize(23 * unit)
+ // context.setFillStyle("red")
+ // context.fillText("¥", 416 * unit, 185 * unit);
+ // context.setFontSize(31 * unit)
+ // var pri0 = th.data.data.shop_price;
+ // if (th.data.prom_act)
+ // pri0 = th.data.prom_act.price;
+
+ // pri0 = parseFloat(pri0).toFixed(2);
+ // context.fillText(pri0, 438 * unit, 185 * unit);
//---市场价划掉---
- context.setFillStyle("gray")
- context.setFontSize(22 * unit)
- context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit);
- context.setStrokeStyle('gray')
- context.setLineWidth(1 * unit)
- context.moveTo(426 * unit, 206 * unit)
- context.lineTo(510 * unit, 206 * unit)
- context.stroke();
+ // context.setFillStyle("gray")
+ // context.setFontSize(22 * unit)
+ // context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit);
+ // context.setStrokeStyle('gray')
+ // context.setLineWidth(1 * unit)
+ // context.moveTo(426 * unit, 206 * unit)
+ // context.lineTo(510 * unit, 206 * unit)
+ // context.stroke();
//---中间大图---
context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
- //-------大图后面就不一样了-----------
- switch (type) {
- case 0: //普通商品的展示
- //中间的几个字
- var g_path = "../../../images/share/s_gou.png";
- context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
- context.setFillStyle("red")
- context.setFontSize(18 * unit)
- context.fillText("正品保证", 84 * unit, 690 * unit);
-
- context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
- context.setFillStyle("red")
- context.setFontSize(18 * unit)
- context.fillText("纯实体店", 246 * unit, 690 * unit);
-
- context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
- context.setFillStyle("red")
- context.setFontSize(18 * unit)
- context.fillText("官方验证", 420 * unit, 690 * unit);
- //---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 710 * unit)
- context.lineTo(520 * unit, 710 * unit)
- context.stroke();
- //---文字---
- context.setFontSize(22 * unit)
- context.setFillStyle("black")
- context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
- context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
- //---二维吗图---
- context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
- break;
- case 1: //秒杀商品的展示
- //---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 670 * unit)
- context.lineTo(520 * unit, 670 * unit)
- context.stroke();
+
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.setFillStyle("black")
+ context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
+ context.fillText("长按识别小程序码", 40 * unit, 826 * unit);
+ //---二维吗图---
+ context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
- //画秒杀的图片
- var miaos_path = '../../../images/share/miao_share.png';
- context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
- //---文字---
- context.setFontSize(22 * unit)
- context.setFillStyle("black")
- context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
- context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
- //---二维吗图---
- context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
- break;
-
- case 2: //会员团和商家团的展示
- //---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 670 * unit)
- context.lineTo(520 * unit, 670 * unit)
- context.stroke();
- //---文字---
- context.setFontSize(22 * unit)
- context.font = 'normal bold';
- context.setFillStyle("black")
- context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
-
- //绘制成团图片
- var ct_img = "../../../images/share/ct_num.png";
- context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
- var ct_num = th.data.prom_act.ct_num;
- context.setFontSize(14 * unit)
- context.font = 'normal';
- context.setFillStyle("red")
- if (ct_num < 10) {
- context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
- } else {
- context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
- }
- context.setFontSize(22 * unit)
- context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
- context.setFillStyle("gray")
- context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
- context.setFillStyle("black")
- context.font = 'normal bold 18px sans-serif';
- context.setFontSize(21.3 * unit)
- context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
- //---二维吗图---
- context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
- break
- case 3: //阶梯团的展示
+ //-------大图后面就不一样了-----------
+ // switch (type) {
+ // case 0: //普通商品的展示
+ //中间的几个字
+ // var g_path = "../../../images/share/s_gou.png";
+ // context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
+ // context.setFillStyle("red")
+ // context.setFontSize(18 * unit)
+ // context.fillText("正品保证", 84 * unit, 690 * unit);
+
+ // context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
+ // context.setFillStyle("red")
+ // context.setFontSize(18 * unit)
+ // context.fillText("纯实体店", 246 * unit, 690 * unit);
+
+ // context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
+ // context.setFillStyle("red")
+ // context.setFontSize(18 * unit)
+ // context.fillText("官方验证", 420 * unit, 690 * unit);
//---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 670 * unit)
- context.lineTo(520 * unit, 670 * unit)
- context.stroke();
+ // context.setLineWidth(1 * unit)
+ // context.moveTo(32 * unit, 710 * unit)
+ // context.lineTo(520 * unit, 710 * unit)
+ // context.stroke();
//---文字---
- context.setFontSize(22 * unit)
- context.font = 'normal bold';
- context.setFillStyle("black")
- context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
- //---绘制中间阶梯的价格---
- var list = th.data.prom_act.ct_rylist;
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var wi = i * 90 * unit;
- context.font = 'normal';
- context.setFontSize(16 * unit)
- context.setFillStyle("red")
- context.fillText("¥", 40 * unit + wi, 756 * unit);
- context.setFontSize(22 * unit)
- var pri = parseFloat(item.price).toFixed(2);
- context.fillText(pri, 56 * unit + wi, 756 * unit);
- context.setFillStyle("gray")
- context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
- }
- //----------------下面部分----------------
- context.setFillStyle("gray")
- context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
- context.setFillStyle("black")
- context.font = 'normal bold 18px sans-serif';
- context.setFontSize(22 * unit)
- context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
- //---二维吗图---
- context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
-
- break
- }
+ // context.setFontSize(22 * unit)
+ // context.setFillStyle("black")
+ // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
+ // context.fillText("长按识别小程序码", 40 * unit, 826 * unit);
+ // //---二维吗图---
+ // context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
+ // break;
+ // case 1: //秒杀商品的展示
+ // //---画线---
+ // context.setLineWidth(1 * unit)
+ // context.moveTo(32 * unit, 670 * unit)
+ // context.lineTo(520 * unit, 670 * unit)
+ // context.stroke();
+
+ // //画秒杀的图片
+ // var miaos_path = '../../../images/share/miao_share.png';
+ // context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
+
+ // //---文字---
+ // context.setFontSize(22 * unit)
+ // context.setFillStyle("black")
+ // context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
+ // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
+ // //---二维吗图---
+ // context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
+ // break;
+
+ // case 2: //会员团和商家团的展示
+ // //---画线---
+ // context.setLineWidth(1 * unit)
+ // context.moveTo(32 * unit, 670 * unit)
+ // context.lineTo(520 * unit, 670 * unit)
+ // context.stroke();
+ // //---文字---
+ // context.setFontSize(22 * unit)
+ // context.font = 'normal bold';
+ // context.setFillStyle("black")
+ // context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+
+ // //绘制成团图片
+ // var ct_img = "../../../images/share/ct_num.png";
+ // context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
+ // var ct_num = th.data.prom_act.ct_num;
+ // context.setFontSize(14 * unit)
+ // context.font = 'normal';
+ // context.setFillStyle("red")
+ // if (ct_num < 10) {
+ // context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
+ // } else {
+ // context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
+ // }
+ // context.setFontSize(22 * unit)
+ // context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
+ // context.setFillStyle("gray")
+ // context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
+ // context.setFillStyle("black")
+ // context.font = 'normal bold 18px sans-serif';
+ // context.setFontSize(21.3 * unit)
+ // context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
+ // //---二维吗图---
+ // context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ // break
+ // case 3: //阶梯团的展示
+ // //---画线---
+ // context.setLineWidth(1 * unit)
+ // context.moveTo(32 * unit, 670 * unit)
+ // context.lineTo(520 * unit, 670 * unit)
+ // context.stroke();
+ // //---文字---
+ // context.setFontSize(22 * unit)
+ // context.font = 'normal bold';
+ // context.setFillStyle("black")
+ // context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+ // //---绘制中间阶梯的价格---
+ // var list = th.data.prom_act.ct_rylist;
+ // for (var i = 0; i < list.length; i++) {
+ // var item = list[i];
+ // var wi = i * 90 * unit;
+ // context.font = 'normal';
+ // context.setFontSize(16 * unit)
+ // context.setFillStyle("red")
+ // context.fillText("¥", 40 * unit + wi, 756 * unit);
+ // context.setFontSize(22 * unit)
+ // var pri = parseFloat(item.price).toFixed(2);
+ // context.fillText(pri, 56 * unit + wi, 756 * unit);
+ // context.setFillStyle("gray")
+ // context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
+ // }
+ // //----------------下面部分----------------
+ // context.setFillStyle("gray")
+ // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
+ // context.setFillStyle("black")
+ // context.font = 'normal bold 18px sans-serif';
+ // context.setFontSize(22 * unit)
+ // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
+ // //---二维吗图---
+ // context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+
+ // break
+ // }
//---绘制圆形要放在最后----
context.save();
diff --git a/pages/justTest/justTest.js b/pages/justTest/justTest.js
new file mode 100644
index 0000000..c36aff5
--- /dev/null
+++ b/pages/justTest/justTest.js
@@ -0,0 +1,177 @@
+// pages/justTest/justTest.js
+// let livePlayer = requirePlugin('live-player-plugin');
+
+
+var t = require("../../utils/util.js"),
+ ut = t,
+ e = require("../../utils/common.js"),
+ a = require("../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+var utils = require('../../utils/util.js'),ut=utils;
+var regeneratorRuntime = require('../../utils/runtime.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ gid: "",
+ stoid: o.stoid,
+ url: o.url,
+ resourceUrl: o.resourceUrl,
+ iurl: o.imghost,
+ defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
+ data: null,
+ openSpecModal: !1,
+ openPromModal: !1,
+ supportPageScroll: !1,
+
+ //联系电话
+ mobile: '',
+ bconfig:null,
+ sales_rules:1,
+
+ t_time:null,
+ card_field:"",
+ dp_price:0,
+ cut_price:0,
+ open_ind_store:1,
+ goodsInputNum:1,
+ g_buy_num: null,
+ sele_collocation:null,
+
+
+
+ photoUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1003256280,1176261798&fm=26&gp=0.jpg",
+ //(用来控制显示哪个按钮) false表示还没首次进行弹框授权,或者已经授权了;true表示在首次授权弹框时拒绝授权,或者在设置页面还是拒绝了授权
+ isAuthSavePhoto: false
+ },
+
+
+
+
+
+ sendRequest: function () {
+
+
+
+ //调用接口判断是不是会员
+ getApp().request.promiseGet("/api/weshop/wx/livelist/page",{
+ data:{store_id: 1}
+ }).then(res=>{
+ console.log(res);
+ // if(res.data.code==0){
+ // getApp().globalData.guide_id=res.data.data.id;
+ // }
+ })
+
+ },
+ // nav: function () {
+ // wx.redirectTo({
+ // url: '/packageA/pages/liveStream/liveStream'
+ // })
+ // },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+
+
+
+ saveImage() {
+ wx.showLoading({
+ title: '保存中...',
+ mask: true,
+ });
+ wx.downloadFile({
+ url:
+ 'http://upload.jianshu.io/admin_banners/web_images/4435/c1d3ca63353c8bd527f0d781605516cb5b266d02.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/1250/h/540',
+ success: function(res) {
+ if (res.statusCode === 200) {
+ let img = res.tempFilePath;
+ wx.saveImageToPhotosAlbum({
+ filePath: img,
+ success(res) {
+ wx.showToast({
+ title: '保存成功',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ fail(res) {
+ wx.showToast({
+ title: '保存失败',
+ icon: 'success',
+ duration: 2000
+ });
+ }
+ });
+ }
+ }
+ });
+ },
+
+
+
+ live() {}
+
+
+})
\ No newline at end of file
diff --git a/pages/justTest/justTest.json b/pages/justTest/justTest.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/justTest/justTest.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/justTest/justTest.wxml b/pages/justTest/justTest.wxml
new file mode 100644
index 0000000..92569ea
--- /dev/null
+++ b/pages/justTest/justTest.wxml
@@ -0,0 +1,46 @@
+
+pages/justTest/justTest.wxml
+进入直播
+进入直播详情页
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/justTest/justTest.wxss b/pages/justTest/justTest.wxss
new file mode 100644
index 0000000..3c29dd4
--- /dev/null
+++ b/pages/justTest/justTest.wxss
@@ -0,0 +1,29 @@
+/* pages/justTest/justTest.wxss */
+page {
+ background: #fff;
+ text-align: center;
+}
+
+.box {
+ padding: 30rpx 80rpx;
+}
+
+.img {
+ width: 430rpx;
+ height: 430rpx;
+ margin: 20rpx 0;
+}
+button {
+ width: 100%;
+ background: #ffffff;
+ border: none;
+ border-radius: 0rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.btn {
+ background: green;
+ color: #ffffff;
+ border-radius: 0;
+}
\ No newline at end of file
diff --git a/utils/myUtils.wxs b/utils/myUtils.wxs
new file mode 100644
index 0000000..bf9f277
--- /dev/null
+++ b/utils/myUtils.wxs
@@ -0,0 +1,42 @@
+var myUtils = {
+ // 判断直播状态
+ liveStatus: function (statusCode) {
+ var statusText;
+ switch(statusCode) {
+ case '101': {
+ statusText = '直播中';
+ break;
+ }
+ case '102': {
+ statusText = '未开始';
+ break;
+ }
+ case '103': {
+ statusText = '已结束';
+ break;
+ }
+ case '104': {
+ statusText = '禁播';
+ break;
+ }
+ case '105': {
+ statusText = '暂停中';
+ break;
+ }
+ case '106': {
+ statusText = '异常';
+ break;
+ }
+ case '107': {
+ statusText = '已过期';
+ break;
+ }
+ default: break;
+ }
+ return statusText;
+ }
+};
+
+module.exports = {
+ liveStatus: myUtils.liveStatus
+}
\ No newline at end of file