作者 lihongjuan

1

正在显示 100 个修改的文件 包含 4597 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

  1 +//app.js
  2 +App({
  3 + onLaunch: function () {
  4 + // 展示本地存储能力
  5 + var logs = wx.getStorageSync('logs') || []
  6 + logs.unshift(Date.now())
  7 + wx.setStorageSync('logs', logs)
  8 + this.getsharepic()
  9 +
  10 + // 登录
  11 + wx.login({
  12 + success: res => {
  13 + // 发送 res.code 到后台换取 openId, sessionKey, unionId
  14 + }
  15 + })
  16 + // 获取用户信息
  17 + wx.getSetting({
  18 + success: res => {
  19 + if (res.authSetting['scope.userInfo']) {
  20 + // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
  21 + wx.getUserInfo({
  22 + success: res => {
  23 + // 可以将 res 发送给后台解码出 unionId
  24 + this.globalData.userInfo = res.userInfo
  25 +
  26 + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
  27 + // 所以此处加入 callback 以防止这种情况
  28 + if (this.userInfoReadyCallback) {
  29 + this.userInfoReadyCallback(res)
  30 + }
  31 + }
  32 + })
  33 + }
  34 + }
  35 + })
  36 + },
  37 +
  38 + // 获取分享图片
  39 + getsharepic(){
  40 + let that = this;
  41 + var url = 'user/share';
  42 + var params = {
  43 +
  44 +
  45 + }
  46 + that.post(url, params,"post").then((res) => {
  47 + console.log(res);
  48 + that.globalData.sharepic = res.thumbnail;
  49 + console.log(that.globalData)
  50 +
  51 +
  52 +
  53 + }).catch((err) => {
  54 +
  55 + })
  56 +
  57 + },
  58 +
  59 + //封装公共接口
  60 +
  61 + post: function (url, data, headerParams) {
  62 + wx.showNavigationBarLoading()
  63 + var promise = new Promise((resolve, reject) => {
  64 + //init
  65 + let that = this;
  66 + let postData = data;
  67 + let baseUrl = 'https://areial.w.broing.cn/api/';
  68 + //网络请求
  69 + let header = {
  70 + // 'XX-Device-Type': 'wxapp',
  71 + 'token': wx.getStorageSync("token") || ''
  72 + }
  73 + header = Object.assign(header, headerParams)
  74 + //网络请求
  75 + wx.request({
  76 + url: baseUrl + url,
  77 + data: postData,
  78 + method: headerParams,
  79 + header: header,
  80 + success: function (res) {
  81 + console.log(res)//返回取得的数据
  82 + if (res.data.code == '1') {
  83 + resolve(res.data.data);
  84 + }else if(res.data.code=='401'){
  85 + wx.showToast({
  86 + title: '请重新登录',
  87 + icon: 'none'
  88 + })
  89 +
  90 + setTimeout(function () {
  91 + wx.navigateTo({
  92 + url: '/pages/index/index',
  93 + })
  94 + }, 1500)
  95 + }else {
  96 + reject(res.data)
  97 + }
  98 +
  99 + },
  100 + fail: function (e) {
  101 + reject('网络出错');
  102 + // wx.hideLoading()
  103 + wx.hideNavigationBarLoading()
  104 + },
  105 + complete: function () {
  106 + wx.hideNavigationBarLoading()
  107 + },
  108 + })
  109 + });
  110 + return promise;
  111 + },
  112 +
  113 + globalData: {
  114 + userInfo: null
  115 + }
  116 +})
  1 +{
  2 + "pages": [
  3 + "pages/startindex/startindex",
  4 + "pages/homepage/homepage",
  5 + "pages/mine/mine",
  6 + "pages/kind/kind",
  7 + "pages/goumaixuzhi/goumaixuzhi",
  8 + "pages/kaifapiao/kaifapiao",
  9 + "pages/lianjie/lianjie",
  10 + "pages/getphone/getphone",
  11 + "pages/index/index",
  12 + "pages/jiesuanpage/jiesuanpage",
  13 + "pages/vipdetail/vipdetail",
  14 + "pages/tupainpic/tupainpic",
  15 + "pages/picdetail/picdetail",
  16 + "pages/videodetail/videodetail",
  17 + "pages/videobox/videobox",
  18 + "pages/xiaofeijilu/xiaofeijilu",
  19 + "pages/picbox/picbox",
  20 + "pages/huiyuanknow/huiyuanknow",
  21 + "pages/chongzhi/chongzhi",
  22 + "pages/orderbox/orderbox",
  23 + "pages/search/search",
  24 + "pages/searchresult/searcgresult",
  25 + "pages/cart/cart",
  26 + "pages/logs/logs",
  27 + "pages/videoplay/videoplay",
  28 + "pages/jingmei/jingmei",
  29 + "pages/fuwuxieyi/fuwuxieyi",
  30 + "pages/pichezi/pichezi",
  31 + "pages/tupianbox/tupianbox",
  32 + "pages/yulanfapiao/yulanfapiao",
  33 + "pages/tousujianyi/tousujianyi",
  34 + "pages/searchsecond/searchsecond"
  35 + ],
  36 + "window": {
  37 + "backgroundTextStyle": "light",
  38 + "navigationBarBackgroundColor": "#fff",
  39 + "navigationBarTitleText": "",
  40 + "navigationBarTextStyle": "black"
  41 + },
  42 + "sitemapLocation": "sitemap.json"
  43 +}
  1 +/**app.wxss**/
  2 +
  3 +page {
  4 + background: #fff;
  5 +}
  6 +
  7 +.container {
  8 + height: 100%;
  9 + display: flex;
  10 + flex-direction: column;
  11 + align-items: center;
  12 + justify-content: space-between;
  13 + padding: 200rpx 0;
  14 + box-sizing: border-box;
  15 +}
  16 +
  17 +image {
  18 + width: 100%;
  19 + height: 100%;
  20 +}
  21 +
  22 +.anniu {
  23 + width: 80rpx;
  24 + height: 80rpx;
  25 + font-size: 0;
  26 + position: absolute;
  27 + left: 50%;
  28 + top: 50%;
  29 + transform: translate(-50%, -50%);
  30 +}
  31 +
  32 +.anniux {
  33 + width: 40rpx;
  34 + height: 40rpx;
  35 + font-size: 0;
  36 + position: absolute;
  37 + left: 50%;
  38 + top: 50%;
  39 + transform: translate(-50%, -50%);
  40 +}
  41 +
  42 +.searchsanjiao {
  43 + width: 21rpx;
  44 + height: 27rpx;
  45 + font-size: 0;
  46 + margin-left: 8rpx;
  47 +}
  48 +
  49 +.xiazairegister {
  50 + width: 100%;
  51 + height: 100%;
  52 + background-color: rgba(0, 0, 0, 0.5);
  53 + position: fixed;
  54 + top: 0;
  55 + left: 0;
  56 + right: 0;
  57 + z-index: 5;
  58 +}
  59 +
  60 +.picxian {
  61 + width: 1rpx;
  62 + height: 48rpx;
  63 + background: #eee;
  64 + margin-left: 18rpx;
  65 +}
  66 +
  67 +.nodata {
  68 + color: #999;
  69 + font-size: 30rpx;
  70 + text-align: center;
  71 + margin-top: 260rpx;
  72 +}
  73 +
  74 +.fangdaimg {
  75 + width: 32rpx;
  76 + height: 32rpx;
  77 + font-size: 0;
  78 + position: absolute;
  79 + bottom: 0;
  80 + right: 0;
  81 +}
  82 +
  83 +.xuantype {
  84 + display: flex;
  85 + align-items: center;
  86 + height: 60rpx;
  87 + background: #f9f9f9;
  88 + padding-right: 24rpx;
  89 + border-radius: 4rpx;
  90 + margin-left: 30rpx;
  91 +}
  92 +
  93 +/* 购买须知 */
  94 +
  95 +.buybox {
  96 + padding: 24rpx;
  97 + box-sizing: border-box;
  98 + color: #3d444d;
  99 + font-size: 28rpx;
  100 + line-height: 1.5;
  101 + /* margin-bottom: 120rpx; */
  102 +}
  103 +
  104 +.secondtitle {
  105 + color: #8c9198;
  106 + font-size: 32rpx;
  107 + text-align: center;
  108 + margin-top: 20rpx;
  109 +}
  110 +
  111 +.goumiatext {
  112 + text-indent: 60rpx;
  113 + margin-top: 20rpx;
  114 +}
  115 +
  116 +.text {
  117 + line-height: 1.5;
  118 +}
  119 +
  120 +.gouxuanleft {
  121 + width: 36rpx;
  122 + height: 36rpx;
  123 + font-size: 0;
  124 +}
  125 +
  126 +.gouxuanleft image {
  127 + width: 100%;
  128 + height: 100%;
  129 +}
  130 +
  131 +.gouxuanright {
  132 + color: #5b5e63;
  133 + font-size: 28rpx;
  134 + margin-left: 20rpx;
  135 + font-weight: bold;
  136 +}
  137 +
  138 +.gouxuan {
  139 + display: flex;
  140 + align-items: center;
  141 + justify-content: center;
  142 + margin-top: 20rpx;
  143 +}
  144 +
  145 +.quebtn {
  146 + width: 286rpx;
  147 + height: 88rpx;
  148 + background: rgba(251, 99, 36, 1);
  149 + opacity: 1;
  150 + border-radius: 44rpx;
  151 + color: #fff;
  152 + font-size: 32rpx;
  153 + text-align: center;
  154 + line-height: 88rpx;
  155 + margin: 40rpx auto 0;
  156 +}
  157 +
  158 +.register {
  159 + width: 100%;
  160 + height: 100%;
  161 + background-color: rgba(0, 0, 0, 0.7);
  162 + position: fixed;
  163 + top: 0;
  164 + left: 0;
  165 + right: 0;
  166 + z-index: 999;
  167 +}
  168 +
  169 +.teacherfooter {
  170 + width: 750rpx;
  171 + display: flex;
  172 + align-items: center;
  173 + justify-content: space-between;
  174 + padding: 18rpx 82rpx;
  175 + box-sizing: border-box;
  176 + position: fixed;
  177 + bottom: 0;
  178 + left: 0;
  179 + background: #fff;
  180 + border-top: 1rpx solid #f5f5f5;
  181 +}
  182 +
  183 +.teacherfootitem {
  184 + display: felx;
  185 + flex-direction: column;
  186 + align-items: center;
  187 + justify-content: center;
  188 +}
  189 +
  190 +.teacherfootitemtop {
  191 + width: 40rpx;
  192 + height: 40rpx;
  193 + font-size: 0;
  194 + margin: 0 auto;
  195 +}
  196 +
  197 +.teacherfootname {
  198 + color: #bdc4ce;
  199 + font-size: 22rpx;
  200 +}
  201 +
  202 +.selactive {
  203 + color: #fb6324;
  204 +}
  205 +
  206 +/* 预约拍摄 */
  207 +
  208 +.crema {
  209 + width: 95rpx;
  210 + height: 95rpx;
  211 + border-radius: 50%;
  212 + background: #fb6324;
  213 + position: fixed;
  214 + bottom: 4rpx;
  215 + left: 50%;
  216 + transform: translateX(-50%);
  217 + display: flex;
  218 + flex-direction: column;
  219 + align-items: center;
  220 + justify-content: center;
  221 + z-index: 999;
  222 +}
  223 +
  224 +.cremaimg {
  225 + width: 42rpx;
  226 + height: 42rpx;
  227 + font-size: 0;
  228 +}
  229 +
  230 +.yuyeu {
  231 + font-size: 20rpx;
  232 + color: #fff;
  233 + margin-top: 2rpx;
  234 +}
  235 +.cremaimgox{
  236 + width:52rpx;
  237 +}
  238 +.phonewrapk {
  239 + width: 508rpx;
  240 + height:293rpx;
  241 + background: #fff;
  242 + position: absolute;
  243 + top: 50%;
  244 + left: 50%;
  245 + transform: translate(-50%, -50%);
  246 + border-radius: 20rpx;
  247 + padding: 32rpx;
  248 + box-sizing: border-box;
  249 + z-index: 999;
  250 +}
  251 +.yuebuzowrap{
  252 + height:213rpx;
  253 +}
  254 +
  255 +.phonename {
  256 + color: #333;
  257 + font-size: 28rpx;
  258 + margin-top: 40rpx;
  259 + font-weight: bold;
  260 + text-align: center;
  261 +}
  262 +.flexone{
  263 + display:flex;
  264 + align-items: center;
  265 +}

949 字节

581 字节

898 字节

935 字节

892 字节

948 字节

839 字节

932 字节

1000 字节

948 字节

455 字节

  1 +// pages/cart/cart.js
  2 +const app = getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + array: ['2k', '4k', '8k'],
  10 + cartindex: 0,
  11 + cartlist: [],
  12 + totalmoney: 0,
  13 + video_id: [],
  14 + pic_id: [],
  15 + totalcartarr: [],
  16 + totalsel: false,
  17 + pp: [],
  18 + diannum: 0,
  19 + hebing: [],
  20 + delshow: false,
  21 + video_attr: [],
  22 + goucartid: [],
  23 + footersel:3,
  24 + type:1
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面加载
  29 + */
  30 + onLoad: function(options) {
  31 +
  32 + },
  33 + ti(){
  34 +
  35 + },
  36 +
  37 + // 数值切换
  38 +   changenum(){
  39 +     let that = this;
  40 +     let url = 'user/change';
  41 +     app.post(url, '', 'post').then((res) => {
  42 +       console.log(res);
  43 +       that.setData({
  44 + //           type:res.type
  45 +       })
  46 +     }).catch((err) => {
  47 +
  48 +     })
  49 +
  50 +   },
  51 +
  52 + // 图片详情
  53 + picdetail(e) {
  54 + console.log(e)
  55 + let id = e.currentTarget.dataset.id
  56 + wx.navigateTo({
  57 + url: '/pages/picdetail/picdetail?id=' + id,
  58 + })
  59 + },
  60 + // 视频详情
  61 +
  62 + videodetail(e) {
  63 + console.log(e)
  64 + let id = e.currentTarget.dataset.id;
  65 + wx.navigateTo({
  66 + url: '/pages/videodetail/videodetail?id=' + id,
  67 + })
  68 + },
  69 +
  70 + manage() {
  71 + this.setData({
  72 + delshow: !this.data.delshow
  73 + })
  74 + },
  75 +
  76 + bindPickerChange: function(e) {
  77 + let newdiannum = this.data.diannum;
  78 + newdiannum++;
  79 + this.setData({
  80 + diannum: newdiannum
  81 + })
  82 + console.log(newdiannum)
  83 + console.log('picker发送选择改变,携带值为', e.detail.value)
  84 + console.log(e)
  85 + let index = e.currentTarget.dataset.index;
  86 + let newcartlist = this.data.cartlist;
  87 +
  88 + let firmoney = newcartlist[index].videoprice
  89 +
  90 + newcartlist[index].cartindex = e.detail.value;
  91 + if (newcartlist[index].video_id.vipprice == undefined) {
  92 + if (newcartlist[index].video_id.videotype[e.detail.value] == '2k') {
  93 + newcartlist[index].videoprice = newcartlist[index].video_id.price
  94 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '4k') {
  95 + newcartlist[index].videoprice = newcartlist[index].video_id.four_price
  96 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '8k') {
  97 + newcartlist[index].videoprice = newcartlist[index].video_id.eight_price
  98 + }
  99 +
  100 + } else {
  101 + if (newcartlist[index].video_id.videotype[e.detail.value] == '2k') {
  102 + newcartlist[index].videoprice = newcartlist[index].video_id.vipprice
  103 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '4k') {
  104 + newcartlist[index].videoprice = newcartlist[index].video_id.four_vipprice
  105 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '8k') {
  106 + newcartlist[index].videoprice = newcartlist[index].video_id.eight_vipprice
  107 + }
  108 +
  109 + }
  110 +
  111 +
  112 + let tt = 0;
  113 + let newtotalmoney = this.data.totalmoney;
  114 +
  115 +
  116 + let pp = this.data.pp;
  117 + pp.push(Number(newcartlist[index].videoprice));
  118 + console.log(pp)
  119 + let len = pp.length;
  120 + tt = Number(tt) + pp[len - 1]
  121 +
  122 + if (newcartlist[index].sel == true) {
  123 + if (this.data.diannum == 1) {
  124 + console.log(newcartlist[index].videoprice)
  125 + newtotalmoney = newtotalmoney - firmoney;
  126 + newtotalmoney = newtotalmoney + tt
  127 + } else {
  128 + newtotalmoney = newtotalmoney - pp[newdiannum - 2];
  129 + console.log()
  130 + newtotalmoney = newtotalmoney + tt
  131 +
  132 + }
  133 + } else {
  134 + newtotalmoney = newtotalmoney + tt
  135 + }
  136 +
  137 + console.log(newtotalmoney)
  138 + if (newcartlist[index].sel == true) {
  139 + this.setData({
  140 + totalmoney: newtotalmoney
  141 + })
  142 + }
  143 +
  144 + let newhebing=this.data.hebing;
  145 +
  146 + for (var i = 0; i < newcartlist.length; i++) {
  147 + for (var j = 0; j < newhebing.length; j++) {
  148 + if (newhebing[j].id == newcartlist[i].id) {
  149 + newhebing[j] = newcartlist[i]
  150 + }
  151 + }
  152 + }
  153 +
  154 + // newcartlist[index].cartindex = e.detail.value;
  155 +
  156 + this.setData({
  157 + cartlist: newcartlist,
  158 + hebing:newhebing
  159 +
  160 + })
  161 +
  162 + console.log(this.data.cartlist);
  163 + console.log(this.data.hebing)
  164 +
  165 +
  166 + },
  167 +
  168 + //获取购物车列表
  169 + getcartlsit() {
  170 + let that = this;
  171 + let url = 'user/car';
  172 +
  173 + app.post(url, '', 'post').then((res) => {
  174 + console.log(res)
  175 + for (var obj of res) {
  176 + obj.sel = false;
  177 + obj.cartindex = 0;
  178 + if (obj.video_id != null) {
  179 + if (obj.video_id.vipprice == undefined) {
  180 + if (obj.video_id.two_url != '') {
  181 + obj.videoprice = obj.video_id.price
  182 + } else if (obj.video_id.four_url != '') {
  183 + obj.videoprice = obj.video_id.four_price
  184 + } else if (obj.video_id.eight_url != '') {
  185 + obj.videoprice = obj.video_id.eight_price
  186 + }
  187 +
  188 + } else {
  189 + if (obj.video_id.two_url != '') {
  190 + obj.videoprice = obj.video_id.vipprice
  191 + } else if (obj.video_id.four_url != '') {
  192 + obj.videoprice = obj.video_id.four_vipprice
  193 + } else if (obj.video_id.eight_url != '') {
  194 + obj.videoprice = obj.video_id.eight_vipprice
  195 + }
  196 +
  197 +
  198 + }
  199 +
  200 + }
  201 + if(obj.pic_id!=null){
  202 + console.log(obj)
  203 + console.log(obj.pic_id.vipprice)
  204 + }
  205 + }
  206 +
  207 + that.setData({
  208 + cartlist: res
  209 + })
  210 +
  211 +
  212 + let newcartlist = res;
  213 +
  214 +
  215 + for (var obj of newcartlist) {
  216 + if (obj.video_id != null) {
  217 + let arr = [];
  218 + if (obj.video_id.eight_url != '') {
  219 + arr.unshift(8 + 'k')
  220 + }
  221 +
  222 + if (obj.video_id.four_url != '') {
  223 + arr.unshift(4 + 'k')
  224 + }
  225 + if (obj.video_id.two_url != '') {
  226 + arr.unshift(2 + 'k')
  227 + }
  228 +
  229 + obj.video_id.videotype = arr
  230 + }
  231 +
  232 + }
  233 +
  234 + that.setData({
  235 + cartlist: newcartlist
  236 + })
  237 +
  238 + console.log(that.data.cartlist)
  239 +
  240 + }).catch((err) => {
  241 +
  242 + })
  243 + },
  244 +
  245 + // 选择购物车
  246 + selcart(e) {
  247 + let that = this;
  248 + let token = wx.getStorageSync("token");
  249 + if (token == '') {
  250 + wx.showToast({
  251 + title: '请先登录',
  252 + icon: 'none'
  253 + })
  254 +
  255 + setTimeout(function() {
  256 + wx.navigateTo({
  257 + url: '/pages/index/index',
  258 + })
  259 + }, 1500)
  260 + } else {
  261 + console.log(e)
  262 + let cartid = e.currentTarget.dataset.cartid;
  263 + let sel = e.currentTarget.dataset.sel;
  264 + let type = e.currentTarget.dataset.type;
  265 + let newpic_id = that.data.pic_id;
  266 + let newvideo_id = that.data.video_id;
  267 + let newgoucartid = that.data.goucartid;
  268 + let newtotalcartarr = that.data.totalcartarr;
  269 + let newcartlist = this.data.cartlist;
  270 + let newtotalmoney = that.data.totalmoney;
  271 + let newhebing = that.data.hebing;
  272 + let newvideo_attr = that.data.video_attr;
  273 +
  274 + for (var obj of newcartlist) {
  275 + if (obj.id == cartid) {
  276 + obj.sel = !obj.sel;
  277 + if (obj.sel == true && type == 1) {
  278 + newvideo_id.push(obj.video_id.id);
  279 + newtotalcartarr.push(cartid);
  280 + newtotalmoney = Number(newtotalmoney) + Number(obj.videoprice);
  281 + newhebing.push(obj)
  282 + console.log('111', newtotalcartarr)
  283 +
  284 + } else if (obj.sel == false && type == 1) {
  285 +
  286 +
  287 + for(var i=0;i<newtotalcartarr.length;i++){
  288 + if (newtotalcartarr[i]==cartid){
  289 + newtotalcartarr.splice(i,1);
  290 + newtotalmoney = Number(newtotalmoney) - Number(obj.videoprice);
  291 + }
  292 + }
  293 +
  294 + console.log('333', newvideo_id, newtotalcartarr)
  295 +
  296 + for (var j = 0; j < newtotalcartarr.length; j++) {
  297 + if (newtotalcartarr[j] == cartid) {
  298 + newtotalcartarr.splice(j, 1)
  299 + }
  300 + }
  301 +
  302 + for (var k = 0; k < newhebing.length; k++) {
  303 + if (newhebing[k].id == cartid) {
  304 + newhebing.splice(k, 1)
  305 + }
  306 + }
  307 +
  308 + } else if (obj.sel == true && type == 2) {
  309 + newpic_id.push(obj.pic_id.id);
  310 + newtotalcartarr.push(cartid);
  311 + newhebing.push(obj)
  312 + if (obj.pic_id.vipprice == undefined) {
  313 + newtotalmoney = Number(newtotalmoney) + Number(obj.pic_id.price)
  314 + } else {
  315 + newtotalmoney = Number(newtotalmoney) + Number(obj.pic_id.vipprice)
  316 + }
  317 +
  318 + console.log(newpic_id, newtotalcartarr)
  319 +
  320 +
  321 + } else if (obj.sel == false && type == 2) {
  322 + for(var i=0;i<newtotalcartarr.length;i++){
  323 + if(newtotalcartarr[i]==cartid){
  324 + newtotalcartarr.splice(i,1);
  325 + if (obj.pic_id.vipprice == undefined) {
  326 + newtotalmoney = Number(newtotalmoney) - Number(obj.pic_id.price)
  327 + } else {
  328 + newtotalmoney = Number(newtotalmoney) - Number(obj.pic_id.vipprice)
  329 + }
  330 + }
  331 + }
  332 +
  333 + // console.log('444', newpic_id, newtotalcartarr);
  334 + // for (var j = 0; j < newtotalcartarr.length; j++) {
  335 + // if (newtotalcartarr[j] == cartid) {
  336 + // newtotalcartarr.splice(j, 1)
  337 + // }
  338 + // }
  339 +
  340 + for (var k = 0; k < newhebing.length; k++) {
  341 + if (newhebing[k].id == cartid) {
  342 + newhebing.splice(k, 1)
  343 + }
  344 +
  345 + }
  346 + }
  347 + }
  348 + }
  349 +
  350 + if (newcartlist.length == newtotalcartarr.length) {
  351 + that.setData({
  352 + totalsel: true
  353 + })
  354 + } else {
  355 + that.setData({
  356 + totalsel: false
  357 + })
  358 + }
  359 +
  360 + newtotalmoney = newtotalmoney.toFixed(2)
  361 +
  362 + that.setData({
  363 + cartlist: newcartlist,
  364 + video_id: newvideo_id,
  365 + pic_id: newpic_id,
  366 + totalcartarr: newtotalcartarr,
  367 + totalmoney: newtotalmoney,
  368 + hebing: newhebing
  369 + })
  370 + console.log(that.data.video_id);
  371 + // console.log(that.data.pic_id);
  372 + // console.log(that.data.totalcartarr);
  373 + // console.log(that.data.totalmoney);
  374 + // console.log(that.data.hebing)
  375 + }
  376 +
  377 +
  378 +
  379 + },
  380 +
  381 + // 全部选择
  382 + selallcart() {
  383 + this.setData({
  384 + totalsel: !this.data.totalsel
  385 + })
  386 +
  387 + let newcartlist = this.data.cartlist;
  388 + let newtotalmoney = 0;
  389 + let newpic_id = this.data.pic_id;
  390 + let newvideo_id = this.data.video_id;
  391 + let newtotalcartarr = [];
  392 + let newhebing = this.data.hebing
  393 +
  394 + if (this.data.totalsel == true) {
  395 +
  396 +
  397 + for (var obj of newcartlist) {
  398 + obj.sel = true;
  399 +
  400 + if (obj.pic_id == null) {
  401 + console.log(obj.video_id)
  402 + newvideo_id.push(obj.video_id.id);
  403 + newtotalcartarr.push(obj.id);
  404 + newhebing.push(obj)
  405 + newtotalmoney = newtotalmoney + Number(obj.videoprice)
  406 +
  407 + // if (obj.video_id.videotype[0] == '2k') {
  408 + // if (obj.video_id.vipprice == undefined) {
  409 + // newtotalmoney = newtotalmoney + obj.video_id.price
  410 + // } else {
  411 + // newtotalmoney = newtotalmoney + obj.video_id.vipprice
  412 + // }
  413 + // } else if (obj.video_id.videotype[0] == '4k') {
  414 + // if (obj.video_id.four_vipprice == undefined) {
  415 + // newtotalmoney = newtotalmoney + obj.video_id.four_price
  416 + // } else {
  417 + // newtotalmoney = newtotalmoney + obj.video_id.four_vipprice
  418 + // }
  419 + // } else if (obj.video_id.videotype[0] == '8k') {
  420 + // if (obj.video_id.four_vipprice == undefined) {
  421 + // newtotalmoney = newtotalmoney + obj.video_id.eight_price
  422 + // } else {
  423 + // newtotalmoney = newtotalmoney + obj.video_id.eight_vipprice
  424 + // }
  425 + // }
  426 +
  427 +
  428 + } else if (obj.video_id == null) {
  429 + newpic_id.push(obj.pic_id.id);
  430 + newtotalcartarr.push(obj.id)
  431 + newhebing.push(obj)
  432 + if (obj.pic_id.vipprice == undefined) {
  433 + newtotalmoney = newtotalmoney + obj.pic_id.price
  434 + } else {
  435 + newtotalmoney = newtotalmoney + obj.pic_id.vipprice
  436 + }
  437 + }
  438 +
  439 + }
  440 +
  441 + } else {
  442 + for (var obj of newcartlist) {
  443 + obj.sel = false;
  444 +
  445 + }
  446 + newtotalmoney = 0;
  447 + newhebing = [];
  448 + newtotalcartarr=[]
  449 +
  450 + }
  451 + newtotalmoney = newtotalmoney.toFixed(2)
  452 + this.setData({
  453 + totalmoney: newtotalmoney,
  454 + cartlist: newcartlist,
  455 + pic_id: newpic_id,
  456 + video_id: newvideo_id,
  457 + totalcartarr: newtotalcartarr,
  458 + hebing: newhebing
  459 +
  460 + })
  461 +
  462 + console.log('76543', this.data.video_id)
  463 + },
  464 +
  465 + hejisuan() {
  466 + let that=this;
  467 + if (that.data.totalcartarr.length == 0) {
  468 + wx.showToast({
  469 + title: '请选结算的视频或图片',
  470 + icon: "none"
  471 + })
  472 + } else {
  473 + let newhebing = that.data.hebing;
  474 + newhebing = JSON.stringify(newhebing);
  475 + let newpic_id = JSON.stringify(that.data.pic_id);
  476 + let newvideo_id = JSON.stringify(that.data.video_id);
  477 + let newtotalcartarr=JSON.stringify(that.data.totalcartarr)
  478 + console.log(newpic_id);
  479 + console.log(newvideo_id)
  480 +
  481 + wx.navigateTo({
  482 + url: '/pages/jiesuanpage/jiesuanpage?totalmoney=' + that.data.totalmoney + '&hebing=' + newhebing + '&totalcartarr=' + newtotalcartarr
  483 + })
  484 + }
  485 + },
  486 +
  487 + delcart() {
  488 + let that = this;
  489 + if (that.data.totalcartarr.length == 0) {
  490 + wx.showToast({
  491 + title: '请选择要删除的图片或视频',
  492 + icon: "none"
  493 + })
  494 + } else {
  495 + let url = 'user/delcar';
  496 +
  497 +
  498 + let param = {
  499 + ids: that.data.totalcartarr.join(",")
  500 + }
  501 + app.post(url, param, 'post').then((res) => {
  502 + console.log(res);
  503 +
  504 + let newcartlist = that.data.cartlist;
  505 + let newtotalmoney = that.data.totalmoney;
  506 + let newtotalcartarr = that.data.totalcartarr;
  507 + let money = 0;
  508 + for (var i = 0; i < newcartlist.length; i++) {
  509 + for (var j = 0; j < newtotalcartarr.length; j++) {
  510 + if (newtotalcartarr[j] == newcartlist[i].id) {
  511 + console.log(newtotalcartarr[j]);
  512 + console.log(newcartlist[i])
  513 + if (newcartlist[i].pic_id == null) {
  514 + console.log(777)
  515 + money = newcartlist[i].videoprice
  516 + newtotalmoney = newtotalmoney - money
  517 +
  518 + } else if (newcartlist[i].video_id == null) {
  519 + if (newcartlist[i].pic_id.vipprice == undefined) {
  520 + money = newcartlist[i].pic_id.price
  521 + } else {
  522 + money = newcartlist[i].pic_id.vipprice
  523 + }
  524 +
  525 + newtotalmoney = newtotalmoney - money
  526 + }
  527 + }
  528 + }
  529 + }
  530 +
  531 +
  532 + that.setData({
  533 + totalmoney: newtotalmoney
  534 + })
  535 +
  536 +
  537 + wx.showToast({
  538 + title: '删除购物车成功',
  539 + icon: 'none'
  540 + })
  541 +
  542 + setTimeout(function() {
  543 + that.getcartlsit();
  544 + that.setData({
  545 + totalcartarr:[],
  546 + totalsel: false
  547 + })
  548 +
  549 + }, 1000)
  550 +
  551 +
  552 + }).catch((err) => {
  553 +
  554 + })
  555 + }
  556 +
  557 +
  558 + },
  559 +
  560 + // 底部导航跳转
  561 + footersel(e) {
  562 + let id = e.currentTarget.dataset.id;
  563 + if (id == 1) {
  564 + wx.redirectTo({
  565 + url: '/pages/homepage/homepage',
  566 + })
  567 + } else if (id == 2) {
  568 + wx.redirectTo({
  569 + url: '/pages/kind/kind',
  570 + })
  571 + } else if (id == 3) {
  572 + wx.redirectTo({
  573 + url: '/pages/cart/cart',
  574 + })
  575 + } else if (id == 4) {
  576 + wx.redirectTo({
  577 + url: '/pages/mine/mine',
  578 + })
  579 + }
  580 + },
  581 +
  582 + /**
  583 + * 生命周期函数--监听页面初次渲染完成
  584 + */
  585 + onReady: function() {
  586 +
  587 + },
  588 +
  589 + /**
  590 + * 生命周期函数--监听页面显示
  591 + */
  592 + onShow: function() {
  593 + let that=this;
  594 + this.getcartlsit();
  595 + this.setData({
  596 + totalmoney: 0,
  597 + video_id: [],
  598 + pic_id: [],
  599 + totalcartarr: [],
  600 + totalsel: false,
  601 + pp: [],
  602 + diannum: 0,
  603 + hebing: []
  604 + })
  605 +
  606 + this.changenum()
  607 +
  608 + wx.getSystemInfo({
  609 + success (res) {
  610 + console.log(res)
  611 + if(res.platform=='ios'){
  612 + that.setData({
  613 + type:0
  614 + })
  615 +
  616 + }else if(res.platform=="android"){
  617 + that.setData({
  618 + type:1
  619 + })
  620 +
  621 + }else if(res.platform=='devtools'){
  622 + // that.setData({
  623 + // type:0
  624 + // })
  625 +
  626 + }
  627 +
  628 +
  629 + }
  630 + })
  631 + },
  632 +
  633 + /**
  634 + * 生命周期函数--监听页面隐藏
  635 + */
  636 + onHide: function() {
  637 +
  638 + },
  639 +
  640 + /**
  641 + * 生命周期函数--监听页面卸载
  642 + */
  643 + onUnload: function() {
  644 +
  645 + },
  646 +
  647 + /**
  648 + * 页面相关事件处理函数--监听用户下拉动作
  649 + */
  650 + onPullDownRefresh: function() {
  651 +
  652 + },
  653 +
  654 + /**
  655 + * 页面上拉触底事件的处理函数
  656 + */
  657 + onReachBottom: function() {
  658 +
  659 + },
  660 +
  661 +
  662 + /**
  663 + * 用户点击右上角分享
  664 + */
  665 + onShareAppMessage: function() {
  666 +
  667 + }
  668 +})
  1 +{
  2 + "navigationBarTitleText": "购物车"
  3 +
  4 +}
  1 +<view class="cartboxhead">
  2 + <view class="del" wx:if="{{delshow}}" bindtap="delcart">删除</view>
  3 + <view class="managerlist">
  4 + <view class="cartboxheadright" bindtap="manage">
  5 + <image src="/img/seetingimger.png"></image>
  6 + </view>
  7 + <view class="cartboxrightname">管理</view>
  8 + </view>
  9 +
  10 +</view>
  11 +<view class="nodata" wx:if="{{cartlist.length==0}}">暂无数据</view>
  12 +<view class="cartbigboxz" wx:else>
  13 +
  14 +
  15 + <view class="cartbox gouwuche" wx:for="{{cartlist}}" wx:key="">
  16 +
  17 + <!-- 视频 -->
  18 + <view class="cartvideo" wx:if="{{item.video_id!=null}}">
  19 + <view class="cartbboxitem" wx:key="" >
  20 + <block catchtap="ti">
  21 + <view class="cartboxitemleft" catchtap="selcart" data-type="1" data-cartid="{{item.id}}">
  22 + <image src="/img/noselect.png" wx:if="{{item.sel==false}}"></image>
  23 + <image src="/img/selectcart.png" wx:else></image>
  24 + </view>
  25 +
  26 + <view class="cartboxitemright">
  27 + <view class="videoitemimg" data-id="{{item.video_id.id}}" bindtap="videodetail">
  28 + <image src="{{item.video_id.thumbnail}}"></image>
  29 +
  30 + <view class="anniu">
  31 + <image src="/img/anniu.png"></image>
  32 + </view>
  33 + </view>
  34 + <view class="cartboxitembottom">
  35 + <view class="cartboxitembotleft">
  36 + {{item.video_id.title}}
  37 + </view>
  38 + <block catchtap="ti">
  39 + <picker bindchange="bindPickerChange" value="{{index}}" range="{{item.video_id.videotype}}" data-index="{{index}}">
  40 + <view class="cartboxitemrightone">
  41 + <view class="cartbox">{{item.video_id.videotype[item.cartindex]}}</view>
  42 +
  43 + <view class="picxian"></view>
  44 +
  45 + <view class="cartxuansan">
  46 + <image src="/img/sanjiaodown.png"></image>
  47 + </view>
  48 + </view>
  49 + </picker>
  50 + </block>
  51 +
  52 + </view>
  53 +
  54 + <view class="money">¥{{item.videoprice}}</view>
  55 + </view>
  56 + </block>
  57 +
  58 + </view>
  59 + </view>
  60 +
  61 +
  62 + <!-- 图片 -->
  63 +
  64 + <view class="picbox" wx:if="{{item.pic_id!=null}}">
  65 + <view class="cartbboxitem" wx:key="" bindtap="picdetail" data-id="{{item.pic_id.id}}">
  66 + <view class="cartboxitemleft" catchtap="selcart" data-type="2" data-cartid="{{item.id}}" data-sel="{{item.sel}}">
  67 + <image src="/img/noselect.png" wx:if="{{item.sel==false}}"></image>
  68 + <image src="/img/selectcart.png" wx:else></image>
  69 + </view>
  70 +
  71 + <view class="cartboxitemright">
  72 + <view class="videoitemimgp">
  73 + <image src="{{item.pic_id.thumbnail}}"></image>
  74 + </view>
  75 + <view class="cartboxitembottom">
  76 + <view class="cartboxitembotleft">
  77 + {{item.pic_id.title}}
  78 + </view>
  79 +
  80 + <!-- <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
  81 +
  82 +
  83 + <view class="cartboxitemrightone">
  84 + <view class="cartbox">{{array[index]}}</view>
  85 +
  86 + <view class="picxian"></view>
  87 +
  88 + <view class="cartxuansan">
  89 + <image src="/img/sanjiaodown.png"></image>
  90 + </view>
  91 + </view>
  92 + </picker> -->
  93 + </view>
  94 +
  95 + <view wx:if="{{type==1}}">
  96 + <view class="money" wx:if="{{item.pic_id.vipprice==undefined}}">¥{{item.pic_id.price}}</view>
  97 + <view class="money" wx:else>¥{{item.pic_id.vipprice}}</view>
  98 + </view>
  99 +
  100 + </view>
  101 + </view>
  102 + </view>
  103 + </view>
  104 +</view>
  105 +
  106 +
  107 +<view class="cartfoot" wx:if="{{type==1}}">
  108 + <view class="cartfootleft">
  109 + <view class="cartfootlefimg" bindtap="selallcart">
  110 + <image src="/img/noselect.png" wx:if="{{totalsel==false}}"></image>
  111 + <image src="/img/selectcart.png" wx:else></image>
  112 + </view>
  113 +
  114 + <view class="cartfootlefthe">合计:¥{{totalmoney}}</view>
  115 + </view>
  116 +
  117 + <view class="cartfootright" bindtap="hejisuan">合并计算({{totalcartarr.length}})</view>
  118 +</view>
  119 +
  120 +<!-- 底部导航 -->
  121 +<view class="teacherfooter">
  122 + <view class="teacherfootitem" bindtap="footersel" data-id="1">
  123 + <view class="teacherfootitemtop shou">
  124 + <image src="{{footersel==1?'/img/shouyeactive.png':'/img/shouye.png'}}"></image>
  125 + </view>
  126 + <view class="teacherfootname {{footersel==1?'selactive':''}}">首页</view>
  127 + </view>
  128 +
  129 +
  130 + <view class="teacherfootitem" bindtap="footersel" data-id="2">
  131 + <view class="teacherfootitemtop order">
  132 + <image src="{{footersel==2?'/img/kindactive.png':'/img/kind.png'}}"></image>
  133 + </view>
  134 + <view class="teacherfootname {{footersel==2?'selactive':''}}">分类</view>
  135 + </view>
  136 +
  137 +
  138 + <view class="teacherfootitem" bindtap="footersel" data-id="3">
  139 + <view class="teacherfootitemtop rili">
  140 + <image src=" {{footersel==3?'/img/cartactive.png':'/img/cart.png'}}"></image>
  141 + </view>
  142 + <view class="teacherfootname {{footersel==3?'selactive':''}}">购物车</view>
  143 + </view>
  144 +
  145 +
  146 + <view class="teacherfootitem" bindtap="footersel" data-id="4">
  147 + <view class="teacherfootitemtop show">
  148 + <image src="{{footersel==4?'/img/mineactive.png':'/img/mine.png'}}"></image>
  149 + </view>
  150 + <view class="teacherfootname {{footersel==4?'selactive':''}}">我的</view>
  151 + </view>
  152 +
  153 +</view>
  1 +.cartbox {
  2 + padding: 24rpx;
  3 + box-sizing: border-box;
  4 + color: #5b5e63;
  5 + font-size: 28rpx;
  6 +}
  7 +
  8 +.gouwuche {
  9 + border-bottom: 24rpx solid #f9f9f9;
  10 +}
  11 +
  12 +.cartbigboxz {
  13 + padding-bottom: 186rpx;
  14 +}
  15 +
  16 +.cartbboxitem {
  17 + display: flex;
  18 + align-items: center;
  19 + /* border-bottom: 1rpx solid #f5f5f5;
  20 + padding-bottom: 48rpx; */
  21 +}
  22 +
  23 +.cartboxitemleft {
  24 + width: 32rpx;
  25 + height: 32rpx;
  26 + font-size: 0;
  27 +}
  28 +
  29 +.cartboxhead {
  30 + display: flex;
  31 + justify-content: flex-end;
  32 + align-items: center;
  33 + padding: 14rpx 36rpx;
  34 + box-sizing: border-box;
  35 + border-bottom: 24rpx solid #f9f9f9;
  36 +}
  37 +
  38 +.managerlist {
  39 + display: flex;
  40 + flex-direction: column;
  41 + justify-content: center;
  42 + align-items: flex-end;
  43 + /* padding: 14rpx 26rpx;
  44 + box-sizing: border-box;
  45 + border-bottom: 24rpx solid #f9f9f9; */
  46 +}
  47 +
  48 +.del {
  49 + width: 180rpx;
  50 + height: 60rpx;
  51 + background: #fb6324;
  52 + color: #fff;
  53 + font-size: 22rpx;
  54 + text-align: center;
  55 + line-height: 60rpx;
  56 + border-radius: 16rpx;
  57 + margin-right: 60rpx;
  58 +}
  59 +
  60 +.cartboxheadright {
  61 + width: 35rpx;
  62 + height: 35rpx;
  63 + font-size: 0;
  64 + margin-right: 5rpx;
  65 +}
  66 +
  67 +.cartboxrightname {
  68 + color: #bdc4ce;
  69 + font-size: 22rpx;
  70 + margin-top: 6rpx;
  71 +}
  72 +
  73 +.videoitemimg {
  74 + width: 640rpx;
  75 + height: 360rpx;
  76 + font-size: 0;
  77 + position: relative;
  78 +}
  79 +
  80 +.videoitemimgp {
  81 + width: 640rpx;
  82 + height: 212rpx;
  83 + font-size: 0;
  84 +}
  85 +
  86 +.cartboxitemright {
  87 + margin-left: 24rpx;
  88 +}
  89 +
  90 +.cartboxitembottom {
  91 + display: flex;
  92 + align-items: center;
  93 + justify-content: space-between;
  94 + margin-top: 24rpx;
  95 +}
  96 +
  97 +.cartboxitemrightone {
  98 + display: flex;
  99 + align-items: center;
  100 + background: #f9f9f9;
  101 + height: 60rpx;
  102 + padding: 0 24rpx;
  103 + box-sizing: border-box;
  104 +}
  105 +
  106 +.cartxuansan {
  107 + width: 28rpx;
  108 + height: 30rpx;
  109 + font-size: 0;
  110 +}
  111 +
  112 +.picxian {
  113 + margin-right: 20rpx;
  114 + box-sizing: border-box;
  115 +}
  116 +
  117 +.money {
  118 + color: #ea322b;
  119 + font-size: 32rpx;
  120 + font-weight: bold;
  121 + margin-top: 15rpx;
  122 +}
  123 +
  124 +.cartfoot {
  125 + display: flex;
  126 + align-items: center;
  127 + justify-content: space-between;
  128 + padding: 0;
  129 + box-sizing: border-box;
  130 + height: 88rpx;
  131 + position: fixed;
  132 + bottom:106rpx;
  133 + left: 0;
  134 +}
  135 +
  136 +.cartfootleft {
  137 + width: 470rpx;
  138 + height: 88rpx;
  139 + padding: 0 32rpx;
  140 + box-sizing: border-box;
  141 + display: flex;
  142 + align-items: center;
  143 + background: #fff;
  144 +}
  145 +
  146 +.cartfootlefimg {
  147 + width: 32rpx;
  148 + height: 32rpx;
  149 + font-size: 0;
  150 + margin-top: 5rpx;
  151 +}
  152 +
  153 +.cartfootlefthe {
  154 + margin-left: 24rpx;
  155 + color: #ea322b;
  156 + font-size: 28rpx;
  157 + font-weight: bold;
  158 +}
  159 +
  160 +.cartfootright {
  161 + width: 280rpx;
  162 + background: #fb6324;
  163 + font-size: 32rpx;
  164 + color: #fff;
  165 + text-align: center;
  166 + height: 88rpx;
  167 + line-height: 88rpx;
  168 +}
  169 +
  170 +.cartboxitembotleft {
  171 + color: #06121e;
  172 + font-size: 28rpx;
  173 + font-weight: bold;
  174 +}
  1 +// pages/chongzhi/chongzhi.js
  2 +const app=getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + weizhi: false,
  10 + agree: false,
  11 + money: '',
  12 + order_id:'',
  13 + hui:1
  14 + },
  15 +
  16 + /**
  17 + * 生命周期函数--监听页面加载
  18 + */
  19 + onLoad: function(options) {
  20 + console.log(this.data.options)
  21 + this.setData({
  22 + hui:options.hui
  23 + })
  24 + },
  25 + chongzhihui(e){
  26 + console.log(e)
  27 + this.setData({
  28 + money:e.detail.value
  29 + })
  30 + },
  31 + chongzhi(e) {
  32 + console.log(e)
  33 + this.setData({
  34 + money: e.detail.value
  35 + })
  36 + },
  37 + huiyuan(){
  38 + console.log(typeof(this.data.hui))
  39 + if(this.data.hui=='1'){
  40 + console.log(9999)
  41 + wx.redirectTo({
  42 + url:'/pages/vipdetail/vipdetail?hui=' + 1,
  43 + })
  44 + }else{
  45 + console.log(888)
  46 + wx.redirectTo({
  47 +
  48 + url: '/pages/vipdetail/vipdetail',
  49 + })
  50 + }
  51 +
  52 + },
  53 +
  54 + xuanzhifu() {
  55 + this.setData({
  56 + weizhi: !this.data.weizhi
  57 + })
  58 + },
  59 +
  60 + agreet() {
  61 + this.setData({
  62 + agree: !this.data.agree
  63 + })
  64 + },
  65 + zhifu(){
  66 + console.log(this.data.money)
  67 +
  68 + if(this.data.money==''){
  69 + wx.showToast({
  70 + title: '请输入充值金额',
  71 + icon:"none"
  72 + })
  73 +
  74 + return false
  75 + }
  76 +
  77 + if (this.data.agree==false){
  78 + wx.showToast({
  79 + title: '请勾选用户须知',
  80 + icon:"none"
  81 + })
  82 +
  83 + return false
  84 + }
  85 +
  86 + if(this.data.money!=''){
  87 + if(this.data.hui==1){
  88 + if(this.data.money<8000){
  89 + wx.showToast({
  90 + title: '请输入超过8000的金额',
  91 + icon:"none"
  92 + })
  93 +
  94 + return false
  95 + }
  96 + }
  97 + }
  98 + if (this.data.hui == 1){
  99 + this.huiyuanorder()
  100 + }else{
  101 + this.feihuiyaun()
  102 + }
  103 +
  104 +
  105 +
  106 + // let that = this;
  107 + // let url = 'user/toporder';
  108 + // let param={
  109 + // money:that.data.money
  110 + // }
  111 + // app.post(url, param, 'post').then((res) => {
  112 + // console.log(res);
  113 + // that.setData({
  114 + // order_id:res.order_id,
  115 + // })
  116 +
  117 + // that.pay()
  118 +
  119 + // }).catch((err) => {
  120 +
  121 + // })
  122 +
  123 + },
  124 + // 非会员订单
  125 + feihuiyaun(){
  126 + let that = this;
  127 + let url = 'user/toporder';
  128 + let param = {
  129 + money: that.data.money
  130 + }
  131 + app.post(url, param, 'post').then((res) => {
  132 + console.log(res);
  133 + that.setData({
  134 + order_id: res.order_id,
  135 + })
  136 +
  137 + that.pay()
  138 +
  139 + }).catch((err) => {
  140 +
  141 + })
  142 + },
  143 +
  144 + // 创建会员订单
  145 + huiyuanorder(){
  146 + let that = this;
  147 + let url = 'user/viporder';
  148 + let param = {
  149 + total: that.data.money
  150 + }
  151 + app.post(url, param, 'post').then((res) => {
  152 + console.log(res);
  153 + that.setData({
  154 + order_id: res.order_id,
  155 + })
  156 +
  157 + that.vipppay()
  158 +
  159 + }).catch((err) => {
  160 + wx.showToast({
  161 + title: err.msg,
  162 + icon:'none'
  163 + })
  164 +
  165 + })
  166 + },
  167 +
  168 +
  169 + // 支付接口
  170 + pay(){
  171 + let that = this;
  172 + let url = 'pay/pay';
  173 + let param = {
  174 + order_id: that.data.order_id
  175 + }
  176 + app.post(url, param, 'post').then((res) => {
  177 + console.log(res);
  178 + that.payment(res)
  179 +
  180 + }).catch((err) => {
  181 +
  182 + })
  183 + },
  184 +
  185 + // 支付接口
  186 + vipppay(){
  187 + let that = this;
  188 + let url = 'pay/vippay';
  189 + let param = {
  190 + order_id: that.data.order_id
  191 + }
  192 + app.post(url, param, 'post').then((res) => {
  193 + console.log(res);
  194 + that.payment(res)
  195 +
  196 + }).catch((err) => {
  197 +
  198 + })
  199 + },
  200 +
  201 + //唤起支付
  202 +
  203 +
  204 + payment(res) {
  205 + let that = this;
  206 + var timeStamp = res.timeStamp.toString();
  207 + // console.log(timeStamp);
  208 + wx.requestPayment({
  209 + timeStamp: timeStamp,
  210 + nonceStr: res.nonceStr,
  211 + package: res.package,
  212 + signType: res.signType,
  213 + paySign: res.paySign,
  214 + success: function (res) {
  215 + console.log(res)
  216 + wx.navigateTo({
  217 + url: '/pages/mine/mine',
  218 + })
  219 +
  220 + },
  221 + fail: function (res) {
  222 + console.log(123);
  223 + console.log(res);
  224 + }
  225 + })
  226 + },
  227 +
  228 + /**
  229 + * 生命周期函数--监听页面初次渲染完成
  230 + */
  231 + onReady: function() {
  232 +
  233 + },
  234 +
  235 + /**
  236 + * 生命周期函数--监听页面显示
  237 + */
  238 + onShow: function() {
  239 +
  240 + },
  241 +
  242 + /**
  243 + * 生命周期函数--监听页面隐藏
  244 + */
  245 + onHide: function() {
  246 +
  247 + },
  248 +
  249 + /**
  250 + * 生命周期函数--监听页面卸载
  251 + */
  252 + onUnload: function() {
  253 +
  254 + },
  255 +
  256 + /**
  257 + * 页面相关事件处理函数--监听用户下拉动作
  258 + */
  259 + onPullDownRefresh: function() {
  260 +
  261 + },
  262 +
  263 + /**
  264 + * 页面上拉触底事件的处理函数
  265 + */
  266 + onReachBottom: function() {
  267 +
  268 + },
  269 +
  270 + /**
  271 + * 用户点击右上角分享
  272 + */
  273 + onShareAppMessage: function() {
  274 +
  275 + }
  276 +})
  1 +{
  2 + "navigationBarTitleText": "充值"
  3 +}
  1 +<view class="chongbox">
  2 + <view class='chongzhir'>充值金额</view>
  3 +
  4 + <view class="chongtext">
  5 + <view class="chongtextleft">
  6 +
  7 + </view>
  8 + <view class="chongtextright">
  9 + <input placeholder='充值8000起' type="digit" bindinput="chongzhihui" placeholder-class="enterhui" wx:if="{{hui==1}}"/>
  10 + <input placeholder='请输入充值金额' type="digit" placeholder-class="enterhui" bindinput="chongzhi" wx:else/>
  11 + </view>
  12 + </view>
  13 +
  14 + <view class='zhifu' bindtap="xuanzhifu">
  15 + <view class="zhifuleft" >
  16 + <image src="/img/xuanze.png"></image>
  17 +
  18 + </view>
  19 +
  20 + <view class="zhifuright">
  21 + <view class="zhifurightl">
  22 + <image src="/img/weixinimg.png"></image>
  23 + </view>
  24 + <view class="zhifurightr">微信支付</view>
  25 + </view>
  26 + </view>
  27 +
  28 +
  29 +
  30 +</view>
  31 +<view class="yuedu" bindtap="agreet">
  32 + <view class="yueduleft" >
  33 + <image src="/img/duigou.png" wx:if="{{agree==true}}"></image>
  34 + <image src="/img/noxieyi.png" wx:else></image>
  35 + </view>
  36 + <view class="yuedutext">
  37 + <view class="yueduagree"> 我已阅读并同意</view>
  38 + <view class="yuedujing" catchtap='huiyuan'>《会员介绍》</view>
  39 + </view>
  40 +</view>
  41 +
  42 +<view class="zhifupay" bindtap="zhifu">支付</view>
  1 +.chongbox {
  2 + padding: 24rpx 32rpx;
  3 + box-sizing: border-box;
  4 +}
  5 +
  6 +.chongzhir {
  7 + color: #06121e;
  8 + font-size: 32rpx;
  9 + font-weight: bold;
  10 +}
  11 +
  12 +.chongtext {
  13 + display: flex;
  14 + align-items: center;
  15 + margin-top: 24rpx;
  16 +}
  17 +
  18 +.chongtextleft {
  19 + color: #06121e;
  20 + font-size: 64rpx;
  21 + font-weight: bold;
  22 +}
  23 +
  24 +.chongtextright {
  25 + width: 500rpx;
  26 + height: 90rpx;
  27 + color: #06121E;
  28 + font-size: 64rpx;
  29 + margin-left: 28rpx;
  30 +}
  31 +.enterhui{
  32 + color:#BDC4CE
  33 +}
  34 +
  35 +.chongtextright input {
  36 + width: 100%;
  37 + height: 100%;
  38 +}
  39 +
  40 +.zhifu {
  41 + display: flex;
  42 + align-items: center;
  43 + margin-top: 24rpx;
  44 +}
  45 +
  46 +.zhifuleft {
  47 + width: 32rpx;
  48 + height: 32rpx;
  49 + font-size: 0;
  50 +}
  51 +
  52 +.zhifuright {
  53 + display: flex;
  54 + align-items: center;
  55 + margin-left: 12rpx;
  56 +}
  57 +
  58 +.zhifurightl {
  59 + width: 56rpx;
  60 + height: 60rpx;
  61 + font-size: 0;
  62 +}
  63 +
  64 +.zhifurightr {
  65 + color: #06121e;
  66 + font-size: 28rpx;
  67 + margin-left: 6rpx;
  68 +}
  69 +
  70 +.yuedu {
  71 + display: flex;
  72 + align-items: center;
  73 + margin-top: 60rpx;
  74 + position: fixed;
  75 + bottom: 156rpx;
  76 + left: 24rpx;
  77 +}
  78 +
  79 +.yueduleft {
  80 + width: 40rpx;
  81 + height: 40rpx;
  82 + font-size: 0;
  83 +}
  84 +
  85 +.yuedutext {
  86 + display: flex;
  87 + align-items: center;
  88 + margin-left: 6rpx;
  89 +}
  90 +
  91 +.yueduagree {
  92 + color: #8c9198;
  93 + font-size: 24rpx;
  94 +}
  95 +
  96 +.yuedujing {
  97 + color: #fb6324;
  98 + font-size: 24rpx;
  99 +}
  100 +
  101 +.zhifupay {
  102 + width: 702rpx;
  103 + height: 88rpx;
  104 + background: rgba(251, 99, 36, 1);
  105 + opacity: 1;
  106 + border-radius: 4rpx;
  107 + color:#FFFFFF;
  108 + font-size: 32rpx;
  109 + text-align: center;
  110 + line-height: 88rpx;
  111 + position: fixed;
  112 + bottom:40rpx;
  113 + left:24rpx;
  114 +}
  1 +// pages/fuwuxieyi/fuwuxieyi.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
  1 +{
  2 + "navigationBarTitleText": "服务协议"
  3 +}
  1 +<view class="huiyuanknow">
  2 +
  3 + <view class="xieyi">亲爱的用户,您好</view>
  4 + <view class="buy">
  5 + 欢迎您购买仁甲看见SHOP素材,请您在购买前务必仔细阅读以下内容:
  6 + </view>
  7 + <view class="item">
  8 + 1充值VIP会员均可享有仁甲看见SHOP图片/视频素材七五折优惠。
  9 + </view>
  10 + <view class="item">
  11 + 2购买的素材将以链接形式发送至您百度云账号。
  12 + </view>
  13 + <view class="item">
  14 + 3购买素材前,请您先下载小样仔细进行预览,购买后概不接受因镜头抖动、闪烁、分辨率等问题的退换。
  15 + </view>
  16 + <view class="item">
  17 + 4 购买后如若您需开发票,请联系后台客服人员,仔细填写个人信息,本公司按您填写的地址邮寄发票。
  18 + </view>
  19 + <view class="item">
  20 + 5 此微信小程序中图片/视频涉及的物权与本公司无关。
  21 + </view>
  22 + <view class="item">
  23 + 6购买的素材仅可以使用于本协议中的指定项目,如若在其他项目中继续使用,须联系客服更新授权书(免费),否则我们将保留通过法律途径追究您侵权责任的权利。
  24 + </view>
  25 +
  26 + <view class="xiyigui">
  27 + 本制度最终解释权归山东仁甲看见影像服务有限公司所有。 如若您仍有其他问题,请联系小程序后台客服人员。
  28 + </view>
  29 +
  30 +
  31 +
  32 +
  33 +</view>
  1 +.huiyuanknow{
  2 + padding: 40rpx 32rpx;
  3 + box-sizing: border-box;
  4 + color:#06121E;
  5 + font-size: 28rpx;
  6 +}
  7 +
  8 +.mai {
  9 + width: 702rpx;
  10 + height: 88rpx;
  11 + background: rgba(251, 99, 36, 1);
  12 + opacity: 1;
  13 + border-radius: 4rpx;
  14 + color:#fff;
  15 + font-size: 32rpx;
  16 + text-align: center;
  17 + line-height: 88rpx;
  18 + margin:0 auto 36rpx;
  19 +
  20 + box-sizing: border-box;
  21 +
  22 +
  23 +}
  24 +.buybottom{
  25 + width:750rpx;
  26 + height:124rpx;
  27 + background: #fff;
  28 + position: fixed;
  29 + bottom:0;
  30 +}
  31 +.buy{
  32 + margin-top: 20rpx;
  33 +
  34 +}
  35 +.item{
  36 + margin-top:10rpx;
  37 + line-height: 1.5
  38 +}
  39 +.xiyigui{
  40 + margin-top:20rpx;
  41 +}
  1 +// pages/getphone/getphone.js
  2 +const app = getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + session_key: '',
  10 + code: '',
  11 + phone:""
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function(options) {
  18 + this.getsessionkey()
  19 + },
  20 +
  21 + //获取sessionkey
  22 + getsessionkey() {
  23 + let that = this;
  24 +
  25 +
  26 + wx.login({
  27 + success: (res) => {
  28 + console.log(res)
  29 + that.setData({
  30 + code: res.code
  31 + })
  32 +
  33 + let url = 'user/getSessionKey',
  34 + params = {
  35 + code: that.data.code
  36 + }
  37 + app.post(url, params).then((res) => {
  38 + console.log(res);
  39 + that.setData({
  40 + session_key: res.session_key
  41 + })
  42 + }).catch((err) => {
  43 +
  44 + })
  45 +
  46 + }
  47 + });
  48 +
  49 + },
  50 +
  51 + //微信授权手机号
  52 + getPhoneNumber(e) {
  53 + console.log(e)
  54 +
  55 +
  56 +
  57 + let that = this;
  58 + let url = 'user/getMobile',
  59 + params = {
  60 + sessionKey: that.data.session_key,
  61 + encryptedData: e.detail.encryptedData,
  62 + iv: e.detail.iv
  63 + }
  64 + app.post(url, params,"post").then((res) => {
  65 + console.log(res);
  66 + that.setData({
  67 + phone:res.tel
  68 + })
  69 + wx.navigateTo({
  70 +
  71 + url: '/pages/homepage/homepage',
  72 + })
  73 + that.bangdingshouji()
  74 +
  75 + }).catch((err) => {
  76 + console.log(err)
  77 +
  78 + })
  79 + },
  80 + bangdingshouji() {
  81 + let that = this;
  82 + let url = 'user/phone',
  83 + params = {
  84 + phone:that.data.phone
  85 + }
  86 + app.post(url, params,"post").then((res) => {
  87 + console.log(res);
  88 +
  89 +
  90 +
  91 +
  92 + }).catch((err) => {
  93 +
  94 + })
  95 + },
  96 +
  97 + /**
  98 + * 生命周期函数--监听页面初次渲染完成
  99 + */
  100 + onReady: function() {
  101 +
  102 + },
  103 +
  104 + /**
  105 + * 生命周期函数--监听页面显示
  106 + */
  107 + onShow: function() {
  108 +
  109 + },
  110 +
  111 + /**
  112 + * 生命周期函数--监听页面隐藏
  113 + */
  114 + onHide: function() {
  115 +
  116 + },
  117 +
  118 + /**
  119 + * 生命周期函数--监听页面卸载
  120 + */
  121 + onUnload: function() {
  122 +
  123 + },
  124 +
  125 + /**
  126 + * 页面相关事件处理函数--监听用户下拉动作
  127 + */
  128 + onPullDownRefresh: function() {
  129 +
  130 + },
  131 +
  132 + /**
  133 + * 页面上拉触底事件的处理函数
  134 + */
  135 + onReachBottom: function() {
  136 +
  137 + },
  138 +
  139 + /**
  140 + * 用户点击右上角分享
  141 + */
  142 + onShareAppMessage: function() {
  143 +
  144 + }
  145 +})
  1 +{
  2 + "navigationBarTitleText": "获取用户手机号"
  3 +}
  1 + <view class="shouquanimg">
  2 + <image src="/img/dun.png"></image>
  3 + </view>
  4 +
  5 + <view class="quanname">仁甲看见SHOP申请获得您的手机号</view>
  6 +
  7 +
  8 +
  9 +
  10 + <button class='bottomtextright' open-type='getPhoneNumber' bindgetphonenumber='getPhoneNumber' >授权微信手机号</button>
  1 +/**index.wxss**/
  2 +
  3 +.userinfo {
  4 + display: flex;
  5 + flex-direction: column;
  6 + align-items: center;
  7 +}
  8 +
  9 +.userinfo-avatar {
  10 + width: 128rpx;
  11 + height: 128rpx;
  12 + margin: 20rpx;
  13 + border-radius: 50%;
  14 +}
  15 +
  16 +.userinfo-nickname {
  17 + color: #aaa;
  18 +}
  19 +
  20 +.usermotto {
  21 + margin-top: 200px;
  22 +}
  23 +
  24 +.shouquanimg {
  25 + width: 172rpx;
  26 + height: 202rpx;
  27 + font-size: 0;
  28 + margin: 244rpx auto 0;
  29 +}
  30 +
  31 +.quanname {
  32 + color: #06121e;
  33 + font-size: 32rpx;
  34 + font-weight: bold;
  35 + margin-top: 48rpx;
  36 + text-align: center;
  37 +}
  38 +
  39 +.huoqu {
  40 + color: #5b5e63;
  41 + font-size: 28rpx;
  42 + margin-top: 16rpx;
  43 + text-align: center;
  44 +}
  45 +
  46 +.bottomtextright {
  47 + width: 486rpx;
  48 + height: 88rpx;
  49 + background: rgba(251, 99, 36, 1);
  50 + opacity: 1;
  51 + border-radius: 44rpx;
  52 + color:#fff;
  53 + font-size: 32rpx;
  54 + margin:100rpx auto 0;
  55 +}
  1 +// pages/goumaixuzhi/goumaixuzhi.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + select:false
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 + selxieyi(){
  18 + this.setData({
  19 + select:!this.data.select
  20 + })
  21 + },
  22 + /**
  23 + * 生命周期函数--监听页面初次渲染完成
  24 + */
  25 + onReady: function () {
  26 +
  27 + },
  28 +
  29 + /**
  30 + * 生命周期函数--监听页面显示
  31 + */
  32 + onShow: function () {
  33 +
  34 + },
  35 +
  36 + /**
  37 + * 生命周期函数--监听页面隐藏
  38 + */
  39 + onHide: function () {
  40 +
  41 + },
  42 +
  43 + /**
  44 + * 生命周期函数--监听页面卸载
  45 + */
  46 + onUnload: function () {
  47 +
  48 + },
  49 +
  50 + /**
  51 + * 页面相关事件处理函数--监听用户下拉动作
  52 + */
  53 + onPullDownRefresh: function () {
  54 +
  55 + },
  56 +
  57 + /**
  58 + * 页面上拉触底事件的处理函数
  59 + */
  60 + onReachBottom: function () {
  61 +
  62 + },
  63 +
  64 + /**
  65 + * 用户点击右上角分享
  66 + */
  67 + onShareAppMessage: function () {
  68 +
  69 + }
  70 +})
  1 +{
  2 + "navigationBarTitleText": "购买须知"
  3 +}
  1 +// pages/homepage/homepage.js
  2 +function getRandomColor() {
  3 + let rgb = []
  4 + for (let i = 0; i < 3; ++i) {
  5 + let color = Math.floor(Math.random() * 256).toString(16)
  6 + color = color.length == 1 ? '0' + color : color
  7 + rgb.push(color)
  8 + }
  9 + return '#' + rgb.join('')
  10 +}
  11 +
  12 +const app = getApp();
  13 +
  14 +Page({
  15 +
  16 + /**
  17 + * 页面的初始数据
  18 + */
  19 + data: {
  20 + array: ['视频', '图片'],
  21 + index: 0,
  22 + jingmeiurl: '',
  23 + picurl: '',
  24 + videourl: '',
  25 + thumbinal: '',
  26 + pic:'',
  27 + image:'',
  28 + phoneshow:false,
  29 + phonenum:'',
  30 + footersel:1
  31 + },
  32 + bindPickerChange: function(e) {
  33 + console.log('picker发送选择改变,携带值为', e.detail.value)
  34 + this.setData({
  35 + index: e.detail.value
  36 + })
  37 + },
  38 +
  39 + // 图片
  40 + picbox() {
  41 + let token = wx.getStorageSync("token");
  42 + if (token == '') {
  43 + wx.showToast({
  44 + title: '请先登录',
  45 + icon: 'none'
  46 + })
  47 +
  48 + setTimeout(function() {
  49 + wx.navigateTo({
  50 + url: '/pages/index/index',
  51 + })
  52 + }, 1500)
  53 + } else {
  54 + wx.navigateTo({
  55 + url: '/pages/pichezi/pichezi',
  56 + })
  57 + }
  58 +
  59 + },
  60 + videobox() {
  61 + let token = wx.getStorageSync("token");
  62 + if (token == '') {
  63 + wx.showToast({
  64 + title: '请先登录',
  65 + icon: 'none'
  66 + })
  67 +
  68 + setTimeout(function() {
  69 + wx.navigateTo({
  70 + url: '/pages/index/index',
  71 + })
  72 + }, 1500)
  73 + } else {
  74 + // wx.navigateTo({
  75 + // url: '/pages/videobox/videobox',
  76 + // })
  77 + wx.navigateTo({
  78 +
  79 + url: '/pages/kind/kind',
  80 + })
  81 + }
  82 +
  83 + },
  84 + hidewrap(){
  85 + this.setData({
  86 + phoneshow:false
  87 + })
  88 + },
  89 +
  90 + // 输入手机号
  91 + enterphone(e){
  92 + this.setData({
  93 + phonenum:e.detail.value
  94 + })
  95 + },
  96 + yuyue(){
  97 + let token=wx.getStorageSync("token");
  98 + if(token==''){
  99 + wx.showToast({
  100 + title: '请先登录',
  101 + icon:'none'
  102 + })
  103 +
  104 + setTimeout(function(){
  105 + wx.navigateTo({
  106 + url: '/pages/index/index',
  107 + })
  108 + },1500)
  109 + }else{
  110 + this.setData({
  111 + phoneshow: true
  112 + })
  113 + }
  114 +
  115 + },
  116 +
  117 + // 确人提交
  118 + surebtn(){
  119 + let that = this;
  120 + if (!(/^1[3456789]\d{9}$/.test(that.data.phonenum))) {
  121 + wx.showToast({
  122 + title: '请输入正确手机号',
  123 + icon: 'none'
  124 + })
  125 + return false;
  126 + }
  127 + var url = '/pay/appointment';
  128 + var params = {
  129 + phone:that.data.phonenum
  130 +
  131 + }
  132 + app.post(url, params,"post").then((res) => {
  133 + console.log(res);
  134 + wx.showToast({
  135 + title: '提交成功',
  136 + icon:"none"
  137 + })
  138 +
  139 + setTimeout(function(){
  140 + that.setData({
  141 + phoneshow:false
  142 + })
  143 + },1500)
  144 +
  145 +
  146 +
  147 + }).catch((err) => {
  148 +
  149 + })
  150 + },
  151 + enter(){
  152 +
  153 + },
  154 + gosearch() {
  155 +
  156 + let token = wx.getStorageSync("token");
  157 + if (token == '') {
  158 + wx.showToast({
  159 + title: '请先登录',
  160 + icon: 'none'
  161 + })
  162 +
  163 + setTimeout(function() {
  164 + wx.navigateTo({
  165 + url: '/pages/index/index',
  166 + })
  167 + }, 1500)
  168 + } else {
  169 + wx.navigateTo({
  170 + url: '/pages/search/search?index=' + this.data.index,
  171 + })
  172 + }
  173 +
  174 + },
  175 + govideo() {
  176 +
  177 + let token = wx.getStorageSync("token");
  178 + if (token == '') {
  179 + wx.showToast({
  180 + title: '请先登录',
  181 + icon: 'none'
  182 + })
  183 +
  184 + setTimeout(function() {
  185 + wx.navigateTo({
  186 + url: '/pages/index/index',
  187 + })
  188 + }, 1500)
  189 + } else {
  190 + wx.navigateTo({
  191 + url: '/pages/jingmei/jingmei'
  192 + })
  193 + }
  194 +
  195 + },
  196 +
  197 + // 获取首页内容
  198 + getindex(e) {
  199 +
  200 +
  201 + let that = this;
  202 + let url = 'user/index';
  203 + app.post(url, '', 'post').then((res) => {
  204 + console.log(res);
  205 +
  206 + that.setData({
  207 + jingmeiurl: res.wonderful_thumbnail,
  208 + picurl: res.pic_thumbnail,
  209 + videourl: res.video_thumbnail
  210 + })
  211 + }).catch((err) => {
  212 +
  213 + })
  214 +
  215 + },
  216 +
  217 + // 封面管理
  218 + fengmian(){
  219 + let that = this;
  220 + var url = 'user/index';
  221 + var params = {
  222 +
  223 +
  224 + }
  225 + app.post(url, params).then((res) => {
  226 + console.log(res);
  227 + this.setData({
  228 + thumbinal: res.thumbnail,
  229 + pic: res.pic,
  230 + image: res.image
  231 +
  232 + })
  233 +
  234 +
  235 +
  236 + }).catch((err) => {
  237 +
  238 + })
  239 + },
  240 +
  241 + // 底部导航跳转
  242 + footersel(e){
  243 + console.log(34343489)
  244 + let id=e.currentTarget.dataset.id;
  245 + console.log(id)
  246 + if(id==1){
  247 + wx.redirectTo({
  248 + url: '/pages/homepage/homepage',
  249 + })
  250 + }else if(id==2){
  251 + wx.redirectTo({
  252 + url: '/pages/kind/kind',
  253 + })
  254 + }else if(id==3){
  255 + wx.redirectTo({
  256 + url: '/pages/cart/cart',
  257 + })
  258 + }else if(id==4){
  259 + wx.redirectTo({
  260 + url: '/pages/mine/mine',
  261 + })
  262 + }
  263 + },
  264 +
  265 +
  266 +
  267 +
  268 +
  269 +
  270 + /**
  271 + * 生命周期函数--监听页面加载
  272 + */
  273 + onLoad: function(options) {
  274 + this.fengmian()
  275 + },
  276 +
  277 + /**
  278 + * 生命周期函数--监听页面初次渲染完成
  279 + */
  280 + onReady: function(res) {
  281 + this.videoContext = wx.createVideoContext('myVideo')
  282 + },
  283 +
  284 + /**
  285 + * 生命周期函数--监听页面显示
  286 + */
  287 + onShow: function() {
  288 + this.getindex()
  289 + },
  290 +
  291 + /**
  292 + * 生命周期函数--监听页面隐藏
  293 + */
  294 + onHide: function() {
  295 +
  296 + },
  297 +
  298 + /**
  299 + * 生命周期函数--监听页面卸载
  300 + */
  301 + onUnload: function() {
  302 +
  303 + },
  304 +
  305 + /**
  306 + * 页面相关事件处理函数--监听用户下拉动作
  307 + */
  308 + onPullDownRefresh: function() {
  309 +
  310 + },
  311 +
  312 + /**
  313 + * 页面上拉触底事件的处理函数
  314 + */
  315 + onReachBottom: function() {
  316 +
  317 + },
  318 +
  319 + /**
  320 + * 用户点击右上角分享
  321 + */
  322 + onShareAppMessage: function() {
  323 + console.log(app.globalData.sharepic)
  324 +
  325 + return {
  326 + title: '仁甲看见SHOP',
  327 + path: '/pages/startindex/startindex',
  328 + imageUrl: app.globalData.sharepic
  329 + }
  330 +
  331 +
  332 + }
  333 +})
  1 +{
  2 + "navigationBarTitleText": "仁甲看见SHOP"
  3 +}
  1 +<view class="videobox">
  2 + <view class="videohead" bindtap="govideo">
  3 + <image src='{{thumbinal}}'></image>
  4 +
  5 + <view class="anniu">
  6 + <image src="/img/anniu.png"></image>
  7 + </view>
  8 + </view>
  9 +
  10 + <view class="search" >
  11 + <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
  12 + <!-- <view class="picker">
  13 + 当前选择:{{array[index]}}
  14 + </view> -->
  15 +
  16 + <view class="searchleft">
  17 + <view class="searchleftname">{{array[index]}}</view>
  18 + <view class="searchsanjiao">
  19 + <image src='/img/sanjiaodown.png'></image>
  20 + </view>
  21 + </view>
  22 + </picker>
  23 +
  24 + <view class="picxian"></view>
  25 +
  26 + <view class="searchright" bindtap="gosearch">
  27 + <view class="searchfightimg">
  28 + <image src="/img/sousuo.png"></image>
  29 + </view>
  30 + <view class="searchrightname" >
  31 + <input placeholder='点击这里搜一搜' />
  32 + </view>
  33 + </view>
  34 +
  35 + <div class="wrapper" bindtap="gosearch">
  36 + <div class="circle">
  37 + <image src="/img/hand.png"></image>
  38 + </div>
  39 + <!-- <div class="finger">
  40 + <image src="/img/shou2.png"></image>
  41 + </div> -->
  42 + </div>
  43 + </view>
  44 +
  45 + <!-- 搜索内容 -->
  46 + <view class="searchbox">
  47 + <!-- 搜索图片 -->
  48 +
  49 + <view class="searchboximg" bindtap="picbox">
  50 + <view class="searchimg">
  51 + <image src="{{pic}}"></image>
  52 + </view>
  53 + </view>
  54 +
  55 + <!-- 搜索视频 -->
  56 + <view class="searchvideo" bindtap="videobox">
  57 + <view class="searchvideoimg">
  58 + <image src="{{image}}"></image>
  59 +
  60 + <view class="anniu">
  61 + <image src="/img/anniu.png"></image>
  62 + </view>
  63 + </view>
  64 +
  65 + </view>
  66 + </view>
  67 +
  68 +</view>
  69 +
  70 +
  71 +
  72 +<!-- 预留电话 -->
  73 +<view class="register" wx:if="{{phoneshow}}" bindtap="hidewrap">
  74 +
  75 + <view class="phonewrap" catchtap='enter'>
  76 + <view class="phonename">请输入您的手机号</view>
  77 + <view class="phoneenter">
  78 + <input placeholder='请输入手机号' bindinput="enterphone" type="number" />
  79 + </view>
  80 +
  81 + <view class="surebtn" bindtap="surebtn">确定</view>
  82 + </view>
  83 +</view>
  84 +
  85 + <view class="crema" bindtap="yuyue">
  86 + <view class="cremaimg">
  87 + <image src="/img/crema.png"></image>
  88 + </view>
  89 +
  90 +
  91 + <!-- <view class='yuyeu'>预约</view> -->
  92 + <view class='yuyeu'>预约拍摄</view>
  93 + </view>
  94 +
  95 +<!-- 底部导航 -->
  96 +<view class="teacherfooter">
  97 + <view class="teacherfootitem" bindtap="footersel" data-id="1">
  98 + <view class="teacherfootitemtop shou">
  99 + <image src="{{footersel==1?'/img/shouyeactive.png':'/img/shouye.png'}}"></image>
  100 + </view>
  101 + <view class="teacherfootname {{footersel==1?'selactive':''}}">首页</view>
  102 + </view>
  103 +
  104 +
  105 + <view class="teacherfootitem" bindtap="footersel" data-id="2">
  106 + <view class="teacherfootitemtop order">
  107 + <image src="{{footersel==2?'/img/kindactive.png':'/img/kind.png'}}"></image>
  108 + </view>
  109 + <view class="teacherfootname {{footersel==2?'selactive':''}}">分类</view>
  110 + </view>
  111 +<view class="cremaimgox"></view>
  112 +
  113 + <view class="teacherfootitem" bindtap="footersel" data-id="3">
  114 + <view class="teacherfootitemtop rili">
  115 + <image src=" {{footersel==3?'/img/cartactive.png':'/img/cart.png'}}"></image>
  116 + </view>
  117 + <view class="teacherfootname {{footersel==3?'selactive':''}}">购物车</view>
  118 + </view>
  119 +
  120 +
  121 + <view class="teacherfootitem" bindtap="footersel" data-id="4">
  122 + <view class="teacherfootitemtop show">
  123 + <image src="{{footersel==4?'/img/mineactive.png':'/img/mine.png'}}"></image>
  124 + </view>
  125 + <view class="teacherfootname {{footersel==4?'selactive':''}}">我的</view>
  126 + </view>
  127 +
  128 +</view>
  1 +page {
  2 + background: #fff;
  3 +}
  4 +
  5 +.videobox {
  6 + padding: 24rpx;
  7 + box-sizing: border-box;
  8 + overflow-x: hidden;
  9 +}
  10 +
  11 +.videohead {
  12 + width: 702rpx;
  13 + height: 395rpx;
  14 + font-size: 0;
  15 + position: relative;
  16 + border-radius: 16rpx;
  17 +}
  18 +
  19 +.videohead image {
  20 + border-radius: 16rpx;
  21 +}
  22 +
  23 +.search {
  24 + display: flex;
  25 + align-items: center;
  26 + margin-top: 24rpx;
  27 + padding:10rpx 20rpx;
  28 + box-sizing: border-box;
  29 + /* background: #F9F9F9; */
  30 + border: 4rpx solid #fb6324;
  31 +}
  32 +
  33 +.searchleft {
  34 + display: flex;
  35 + align-items: center;
  36 +}
  37 +
  38 +.searchright {
  39 + width:369rpx;
  40 + display: flex;
  41 + align-items: center;
  42 + margin-left: 36rpx;
  43 +}
  44 +
  45 +.searchsanjiao {
  46 + width: 28rpx;
  47 + height: 30rpx;
  48 + font-size: 0;
  49 + margin-left: 8rpx;
  50 +}
  51 +
  52 +.searchfightimg {
  53 + width: 40rpx;
  54 + height: 40rpx;
  55 + font-size: 0;
  56 +}
  57 +
  58 +.searchrightname {
  59 + width:285rpx;
  60 + margin-left: 22rpx;
  61 + color: #8c9198;
  62 + font-size: 30rpx;
  63 +}
  64 +.searchrightname input{
  65 + width:100%;
  66 +}
  67 +.searchleftname {
  68 + color: #8c9198;
  69 + font-size: 32rpx;
  70 +}
  71 +
  72 +.searchimg {
  73 + width: 702rpx;
  74 + height: 235rpx;
  75 + font-size: 0;
  76 + margin-top: 24rpx;
  77 + border-radius: 16rpx;
  78 +}
  79 +
  80 +.searchimg image {
  81 + border-radius: 16rpx;
  82 +}
  83 +
  84 +.searchbox {
  85 + margin-top: 48rpx;
  86 + padding-bottom: 120rpx;
  87 +}
  88 +
  89 +.searchvideoimg {
  90 + width: 702rpx;
  91 + height: 395rpx;
  92 + font-size: 0;
  93 + margin-top: 24rpx;
  94 + position: relative;
  95 + border-radius: 16rpx;
  96 +}
  97 +
  98 +.searchvideoimg image {
  99 + border-radius: 16rpx;
  100 +}
  101 +
  102 +.crema {
  103 + width: 95rpx;
  104 + height: 95rpx;
  105 + border-radius: 50%;
  106 + background: #fb6324;
  107 + position: fixed;
  108 + bottom: 4rpx;
  109 + left: 50%;
  110 + transform: translateX(-50%);
  111 + display: flex;
  112 + flex-direction: column;
  113 + align-items: center;
  114 + justify-content: center;
  115 + z-index:999
  116 +}
  117 +
  118 +.cremaimg {
  119 + width: 42rpx;
  120 + height: 42rpx;
  121 + font-size: 0;
  122 +}
  123 +
  124 +.yuyeu {
  125 + font-size: 20rpx;
  126 + color: #fff;
  127 + margin-top: 2rpx;
  128 +}
  129 +
  130 +.phonewrap {
  131 + width: 508rpx;
  132 + height: 400rpx;
  133 + background: #fff;
  134 + position: absolute;
  135 + top: 50%;
  136 + left: 50%;
  137 + transform: translate(-50%, -50%);
  138 + border-radius: 20rpx;
  139 + padding: 32rpx;
  140 + box-sizing: border-box;
  141 + z-index: 999;
  142 +}
  143 +
  144 +.phonename {
  145 + color: #333;
  146 + font-size: 28rpx;
  147 + margin-top: 40rpx;
  148 + font-weight: bold;
  149 + text-align: center;
  150 +}
  151 +
  152 +.phoneenter {
  153 + width: 410rpx;
  154 + height: 85rpx;
  155 + background: #f9f9f9;
  156 + border-radius: 10rpx;
  157 + font-size: 0;
  158 + margin: 44rpx auto 0;
  159 +}
  160 +
  161 +.phoneenter input {
  162 + width: 410rpx;
  163 + height: 85rpx;
  164 + padding: 12rpx;
  165 + box-sizing: border-box;
  166 + color: #8c9198;
  167 + font-size: 28rpx;
  168 + text-align: center;
  169 +}
  170 +
  171 +.surebtn {
  172 + width: 180rpx;
  173 + height: 70rpx;
  174 + border-radius: 40rpx;
  175 + color: #fff;
  176 + font-size: 28rpx;
  177 + text-align: center;
  178 + line-height: 70rpx;
  179 + margin: 65rpx auto 0;
  180 + background: #fb6324;
  181 +}
  182 +
  183 +.wrapper {
  184 + /* position: absolute;
  185 + top: 50%;
  186 + left: 50%; */
  187 + position: relative;
  188 + /* overflow: hidden; */
  189 + width: 60rpx;
  190 + height: 60rpx;
  191 + margin: 0 auto;
  192 + background-color: transparent;
  193 +
  194 +
  195 + /* margin: -250px 0 0 -250px; */
  196 +}
  197 +
  198 +.circle {
  199 + position: absolute;
  200 + left: 15rpx;
  201 + top: 8rpx;
  202 + /* transform: translate(-50%,-50%); */
  203 + /* background: url("https://areial.w.broing.cn/uploads/20191120/hand.png") center center no-repeat; */
  204 + width: 50rpx;
  205 + height: 48rpx;
  206 + font-size: 0;
  207 + animation: circleHide 1s ease infinite both;
  208 +}
  209 +image{
  210 + width:100%;
  211 + height:100%;
  212 +}
  213 +
  214 +.finger {
  215 + /* background: url("https://areial.w.broing.cn/uploads/20191120/hand.png") center center no-repeat; */
  216 + width:30rpx;
  217 + height: 30rpx;
  218 + position: absolute;
  219 + top:0;
  220 + left:16rpx;
  221 + animation: fingerHandle 1s ease infinite both;
  222 + font-size: 0
  223 +}
  224 +
  225 +@keyframes fingerHandle {
  226 + 0% {
  227 + transform: none;
  228 + }
  229 +
  230 + 70% {
  231 + transform: scale3d(2, 2, 2);
  232 + }
  233 +
  234 + 100% {
  235 + transform: none;
  236 + }
  237 +}
  238 +
  239 +@keyframes circleHide {
  240 + 0% {
  241 + opacity: 0;
  242 + transform: scale3d(0, 0, 0);
  243 + }
  244 +
  245 + 70% {
  246 + opacity: 1;
  247 + transform: scale3d(1.2, 1.2, 1.2);
  248 + }
  249 +
  250 + 100% {
  251 + opacity: 0;
  252 + transform: scale3d(0, 0, 0);
  253 + }
  254 +}
  1 +// pages/huiyuanknow/huiyuanknow.js
  2 +var WxParse = require('../../wxParse/wxParse.js');
  3 +const app=getApp()
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + knowdetail:''
  11 + },
  12 +
  13 + /**
  14 + * 生命周期函数--监听页面加载
  15 + */
  16 + onLoad: function (options) {
  17 + this.huiyuankonw()
  18 + },
  19 +
  20 + huiyuankonw(){
  21 + let that = this;
  22 + let url = 'user/vipdetail';
  23 + app.post(url, '', 'post').then((res) => {
  24 + console.log(res);
  25 + this.setData({
  26 + knowdetail:res
  27 + })
  28 + WxParse.wxParse('article', 'html', res.desc, that, 5);
  29 +
  30 +
  31 +
  32 +
  33 +
  34 + }).catch((err) => {
  35 +
  36 + })
  37 + },
  38 +
  39 + buyhuiyuan(){
  40 + wx.navigateTo({
  41 + url: '/pages/chongzhi/chongzhi?hui='+1,
  42 + })
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面初次渲染完成
  47 + */
  48 + onReady: function () {
  49 +
  50 + },
  51 +
  52 + /**
  53 + * 生命周期函数--监听页面显示
  54 + */
  55 + onShow: function () {
  56 +
  57 + },
  58 +
  59 + /**
  60 + * 生命周期函数--监听页面隐藏
  61 + */
  62 + onHide: function () {
  63 +
  64 + },
  65 +
  66 + /**
  67 + * 生命周期函数--监听页面卸载
  68 + */
  69 + onUnload: function () {
  70 +
  71 + },
  72 +
  73 + /**
  74 + * 页面相关事件处理函数--监听用户下拉动作
  75 + */
  76 + onPullDownRefresh: function () {
  77 +
  78 + },
  79 +
  80 + /**
  81 + * 页面上拉触底事件的处理函数
  82 + */
  83 + onReachBottom: function () {
  84 +
  85 + },
  86 +
  87 + /**
  88 + * 用户点击右上角分享
  89 + */
  90 + onShareAppMessage: function () {
  91 +
  92 + }
  93 +})
  1 +{
  2 + "navigationBarTitleText": "会员须知"
  3 +}
  1 +<import src="../../wxParse/wxParse.wxml" />
  2 +
  3 +<view class="huiyuanknow">
  4 + <!-- {{knowdetail.desc}} -->
  5 + <template is="wxParse" data="{{wxParseData:article.nodes}}" />
  6 +</view>
  7 +
  8 +<view class="buybottom" bindtap="buyhuiyuan">
  9 + <view class="mai">确定</view>
  10 +</view>
  1 +.huiyuanknow{
  2 + padding: 40rpx 32rpx;
  3 + box-sizing: border-box;
  4 + color:#06121E;
  5 + font-size: 28rpx;
  6 +}
  7 +
  8 +.mai {
  9 + width: 702rpx;
  10 + height: 88rpx;
  11 + background: rgba(251, 99, 36, 1);
  12 + opacity: 1;
  13 + border-radius: 4rpx;
  14 + color:#fff;
  15 + font-size: 32rpx;
  16 + text-align: center;
  17 + line-height: 88rpx;
  18 + margin:0 auto 36rpx;
  19 +
  20 + box-sizing: border-box;
  21 +
  22 +
  23 +}
  24 +.buybottom{
  25 + width:750rpx;
  26 + height:124rpx;
  27 + background: #fff;
  28 + position: fixed;
  29 + bottom:0;
  30 +}
  1 +//index.js
  2 +//获取应用实例
  3 +const app = getApp()
  4 +
  5 +Page({
  6 + data: {
  7 + url: '',
  8 + thumb: '',
  9 + title: '',
  10 + type:0
  11 + },
  12 +
  13 + onLoad: function (options) {
  14 + console.log('99999',options)
  15 + if(options.title!=undefined){
  16 + this.setData({
  17 + url:options.url,
  18 + thumb:options.thumb,
  19 + title:options.title
  20 + })
  21 + }
  22 + },
  23 + onShow(){
  24 + let that=this
  25 + wx.getSystemInfo({
  26 + success (res) {
  27 + console.log(res)
  28 + if(res.platform=='ios'){
  29 + that.setData({
  30 + type:1
  31 + })
  32 + }else if(res.platform=="android"){
  33 + that.setData({
  34 + type:0
  35 + })
  36 + }else if(res.platform=='devtools'){
  37 +
  38 + }
  39 + }
  40 + })
  41 + },
  42 +
  43 + // 登录
  44 + start(e) {
  45 + console.log(e)
  46 + let that = this;
  47 + wx.getSetting({
  48 + success(res) {
  49 + // console.log("res", res)
  50 + if (res.authSetting['scope.userInfo']) {
  51 + console.log("已授权=====")
  52 + wx.login({
  53 + success: (res) => {
  54 + console.log(res)
  55 + // wx.setStorageSync("code", res.code)
  56 + let url = 'user/login';
  57 + let params = {
  58 + type:that.data.type,
  59 + code: res.code,
  60 + nickname: e.detail.userInfo.nickName,
  61 + avatar: e.detail.userInfo.avatarUrl, //分享进入的需要此参数
  62 + }
  63 + app.post(url, params, 'post').then((res) => {
  64 + console.log(res)
  65 + wx.setStorageSync('token', res.token);
  66 + wx.setStorageSync("openid", res.openid);
  67 + if(that.data.title==''){
  68 + wx.navigateTo({
  69 + url: '/pages/getphone/getphone',
  70 + })
  71 + }else{
  72 + wx.navigateTo({
  73 + url: '/pages/videoplay/videoplay?url=' + that.data.url + '&thumb=' + that.data.thumb + '&title=' + that.data.title,
  74 + })
  75 + }
  76 + // wx.switchTab({
  77 + // url: '/pages/homepage/homepage',
  78 + // })
  79 + }).catch((errMsg) => {
  80 + console.log(errMsg)
  81 + wx.navigateTo({
  82 + url: '/pages/homepage/homepage',
  83 + })
  84 + })
  85 +
  86 + }
  87 + });
  88 + } else {
  89 + console.log("未授权=====")
  90 + wx.navigateTo({
  91 +
  92 + url: '/pages/homepage/homepage',
  93 + })
  94 + }
  95 + }
  96 + })
  97 +
  98 +
  99 + },
  100 +
  101 +})
  1 +{
  2 + "navigationBarTitleText": "仁甲看见SHOP"
  3 +}
  1 + <view class="shouquanimg">
  2 + <image src="/img/dun.png"></image>
  3 + </view>
  4 +
  5 + <view class="quanname">仁甲看见SHOP申请获得以下权限</view>
  6 + <view class="huoqu">获得你的公开信息(昵称,头像等)</view>
  7 +
  8 +
  9 + <button open-type="getUserInfo" bindgetuserinfo='start' class="bottomtextright" >微信授权</button>
  1 +/**index.wxss**/
  2 +
  3 +.userinfo {
  4 + display: flex;
  5 + flex-direction: column;
  6 + align-items: center;
  7 +}
  8 +
  9 +.userinfo-avatar {
  10 + width: 128rpx;
  11 + height: 128rpx;
  12 + margin: 20rpx;
  13 + border-radius: 50%;
  14 +}
  15 +
  16 +.userinfo-nickname {
  17 + color: #aaa;
  18 +}
  19 +
  20 +.usermotto {
  21 + margin-top: 200px;
  22 +}
  23 +
  24 +.shouquanimg {
  25 + width: 172rpx;
  26 + height: 202rpx;
  27 + font-size: 0;
  28 + margin: 244rpx auto 0;
  29 +}
  30 +
  31 +.quanname {
  32 + color: #06121e;
  33 + font-size: 32rpx;
  34 + font-weight: bold;
  35 + margin-top: 48rpx;
  36 + text-align: center;
  37 +}
  38 +
  39 +.huoqu {
  40 + color: #5b5e63;
  41 + font-size: 28rpx;
  42 + margin-top: 16rpx;
  43 + text-align: center;
  44 +}
  45 +
  46 +.bottomtextright {
  47 + width: 686rpx;
  48 + height: 88rpx;
  49 + background: rgba(251, 99, 36, 1);
  50 + opacity: 1;
  51 + border-radius: 44rpx;
  52 + color:#fff;
  53 + font-size: 32rpx;
  54 + position: fixed;
  55 + bottom:48rpx;
  56 + left:32rpx;
  57 +}
  1 +// pages/cart/cart.js
  2 +const app = getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + array: ['2k', '4k', '8k'],
  10 + cartindex: 0,
  11 + cartlist: [],
  12 + totalmoney: 0,
  13 + video_id: [],
  14 + pic_id: [],
  15 + totalcartarr: [],
  16 + totalsel: false,
  17 + pp: [],
  18 + diannum: 0,
  19 + hebing: [],
  20 + order_id: '',
  21 + tixian: false,
  22 + xieyi: false,
  23 + money: "",
  24 + type: 1,
  25 + yu: true,
  26 + wei: false,
  27 + myinfo: '',
  28 + video_attr: [],
  29 + totalcartarr: [],
  30 + xuzhi: false,
  31 + select: false,
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面加载
  36 + */
  37 + onLoad: function(options) {
  38 +
  39 +
  40 + console.log(options);
  41 + let newtotal = JSON.parse(options.totalmoney);
  42 + newtotal = newtotal.toFixed(2)
  43 + this.setData({
  44 + cartlist: JSON.parse(options.hebing),
  45 + totalmoney: newtotal,
  46 + totalcartarr: JSON.parse(options.totalcartarr)
  47 + // pic_id: JSON.parse(options.pic_id),
  48 + // video_id: JSON.parse(options.video_id),
  49 +
  50 + })
  51 +
  52 + this.getmyinfo()
  53 +
  54 + console.log(this.data.cartlist);
  55 + console.log(typeof(this.data.totalmoney));
  56 + console.log(this.data.pic_id);
  57 + console.log(this.data.video_id)
  58 +
  59 +
  60 + },
  61 + ti() {
  62 +
  63 + },
  64 +
  65 + getmyinfo() {
  66 + let that = this;
  67 + let url = 'user/mine';
  68 + app.post(url, '', 'post').then((res) => {
  69 + console.log(res);
  70 + that.setData({
  71 + money: res.money,
  72 + myinfo: res
  73 + })
  74 +
  75 + if (res.is_vip==0){
  76 + that.setData({
  77 + type:2,
  78 + wei:true
  79 + })
  80 + }else{
  81 + that.setData({
  82 + type: 1,
  83 + wei: false
  84 + })
  85 + }
  86 +
  87 +
  88 + }).catch((err) => {
  89 +
  90 + })
  91 +
  92 + },
  93 +
  94 + hidetixian() {
  95 + this.setData({
  96 + tixian: false
  97 + })
  98 + },
  99 +
  100 + // 余额支付和微信支付
  101 + yuzhi() {
  102 + this.setData({
  103 + yu: !this.data.yu,
  104 + wei: false
  105 + })
  106 +
  107 + if (this.data.yu == true) {
  108 + this.setData({
  109 + type: 1
  110 + })
  111 + } else {
  112 + this.setData({
  113 + type: 0
  114 + })
  115 + }
  116 + },
  117 +
  118 + weizhi() {
  119 + this.setData({
  120 + wei: !this.data.wei,
  121 + yu: false
  122 + })
  123 +
  124 + if (this.data.wei == true) {
  125 + this.setData({
  126 + type: 2
  127 + })
  128 + } else {
  129 + this.setData({
  130 + type: 0
  131 + })
  132 + }
  133 + },
  134 +
  135 + xuanxie() {
  136 + this.setData({
  137 + xieyi: !this.data.xieyi
  138 + })
  139 + },
  140 +
  141 +
  142 +
  143 + bindPickerChange: function(e) {
  144 + let newdiannum = this.data.diannum;
  145 + newdiannum++;
  146 + this.setData({
  147 + diannum: newdiannum
  148 + })
  149 + console.log(newdiannum)
  150 + console.log('picker发送选择改变,携带值为', e.detail.value)
  151 + console.log(e)
  152 + let index = e.currentTarget.dataset.index;
  153 + let newcartlist = this.data.cartlist;
  154 +
  155 + let firmoney = newcartlist[index].videoprice
  156 +
  157 + newcartlist[index].cartindex = e.detail.value;
  158 + if (newcartlist[index].video_id.vipprice == undefined) {
  159 + if (newcartlist[index].video_id.videotype[e.detail.value] == '2k') {
  160 + newcartlist[index].videoprice = newcartlist[index].video_id.price
  161 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '4k') {
  162 + newcartlist[index].videoprice = newcartlist[index].video_id.four_price
  163 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '8k') {
  164 + newcartlist[index].videoprice = newcartlist[index].video_id.eight_price
  165 + }
  166 +
  167 +
  168 +
  169 + } else {
  170 + if (newcartlist[index].video_id.videotype[e.detail.value] == '2k') {
  171 + newcartlist[index].videoprice = newcartlist[index].video_id.vipprice
  172 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '4k') {
  173 + newcartlist[index].videoprice = newcartlist[index].video_id.four_vipprice
  174 + } else if (newcartlist[index].video_id.videotype[e.detail.value] == '8k') {
  175 + newcartlist[index].videoprice = newcartlist[index].video_id.eight_vipprice
  176 + }
  177 +
  178 + }
  179 +
  180 +
  181 + let tt = 0;
  182 + let newtotalmoney = this.data.totalmoney;
  183 + console.log('11223344', newtotalmoney)
  184 +
  185 + let pp = this.data.pp;
  186 + pp.push(Number(newcartlist[index].videoprice));
  187 + console.log(pp)
  188 + let len = pp.length;
  189 + tt = Number(tt) + pp[len - 1]
  190 +
  191 + if (newcartlist[index].sel == true) {
  192 + if (this.data.diannum == 1) {
  193 + console.log(newcartlist[index].videoprice)
  194 + newtotalmoney = newtotalmoney - firmoney;
  195 + newtotalmoney = newtotalmoney + tt
  196 + } else {
  197 + newtotalmoney = newtotalmoney - pp[newdiannum - 2];
  198 + console.log()
  199 + newtotalmoney = newtotalmoney + tt
  200 +
  201 + }
  202 +
  203 + console.log(tt)
  204 + // if (newdiannum == 1) {
  205 + // newtotalmoney = newtotalmoney - newcartlist[index].videoprice;
  206 + // newtotalmoney = newtotalmoney + tt;
  207 + // console.log('9999', newtotalmoney)
  208 + // } else {
  209 + // console.log('990099',newtotalmoney)
  210 + // console.log(pp)
  211 + // for (var i = 0; i < pp.length; i++) {
  212 + // newtotalmoney = newtotalmoney - pp[i]
  213 + // }
  214 + // console.log('666',newtotalmoney)
  215 + // newtotalmoney = newtotalmoney + tt
  216 + // }
  217 +
  218 + } else {
  219 + newtotalmoney = newtotalmoney + tt
  220 + }
  221 +
  222 + console.log(newtotalmoney)
  223 +
  224 + // if(len==1){
  225 + // tt = Number(tt) + pp[len - 1];
  226 + // console.log(tt);
  227 +
  228 + // }else{
  229 + // for (var i = 0; i < pp.length; i++) {
  230 + // newtotalmoney = newtotalmoney - pp[i];
  231 + // console.log(newtotalmoney)
  232 + // }
  233 +
  234 +
  235 + // }
  236 +
  237 +
  238 + // newtotalmoney = Number(newtotalmoney) +tt
  239 + // newcartlist[index].videoprice = newcartlist[index].video_id.videotype[e.detail.value]
  240 + newtotalmoney = newtotalmoney.toFixed(2)
  241 + if (newcartlist[index].sel == true) {
  242 + this.setData({
  243 + totalmoney: newtotalmoney
  244 + })
  245 + }
  246 + this.setData({
  247 + cartlist: newcartlist,
  248 +
  249 + })
  250 +
  251 +
  252 + },
  253 +
  254 +
  255 +
  256 + pay() {
  257 + let that = this;
  258 +
  259 + let newcartlist = that.data.cartlist;
  260 + let newvideo_id = [];
  261 + let newpic_id = [];
  262 + let newvideo_attr = [];
  263 + for (var obj of newcartlist) {
  264 + if (obj.pic_id == null) {
  265 + newvideo_id.push(obj.video_id.id);
  266 + if (obj.video_id.videotype[obj.cartindex] == '2k') {
  267 + newvideo_attr.push(1)
  268 + } else if (obj.video_id.videotype[obj.cartindex] == '4k') {
  269 + newvideo_attr.push(2)
  270 + } else if (obj.video_id.videotype[obj.cartindex] == '8k') {
  271 + newvideo_attr.push(3)
  272 + }
  273 + } else if (obj.video_id == null) {
  274 + newpic_id.push(obj.pic_id.id)
  275 + }
  276 + }
  277 +
  278 + that.setData({
  279 + video_id: newvideo_id,
  280 + pic_id: newpic_id,
  281 + video_attr: newvideo_attr
  282 +
  283 + })
  284 +
  285 +
  286 +
  287 +
  288 + let url = 'user/orders';
  289 + let param = {
  290 + video_id: that.data.video_id.join(","),
  291 + pic_id: that.data.pic_id.join(","),
  292 + total: that.data.totalmoney,
  293 + video_attr: that.data.video_attr.join(",")
  294 + }
  295 + app.post(url, param, 'post').then((res) => {
  296 + console.log(res);
  297 + that.setData({
  298 + order_id: res.order_id,
  299 + tixian: true
  300 + })
  301 +
  302 +
  303 + }).catch((err) => {
  304 + console.log(err);
  305 + let pic_id = err.msg.pic_id;
  306 + let video_id = err.msg.video_id;
  307 + console.log(pic_id);
  308 + console.log(video_id)
  309 + if (pic_id == undefined) {
  310 + let newcartlist = that.data.cartlist;
  311 + console.log(newcartlist);
  312 + for (var obj of newcartlist) {
  313 + if (obj.video_id.id == video_id) {
  314 + wx.showToast({
  315 + title: '已经购买过' + obj.video_id.title,
  316 + icon: 'none'
  317 + })
  318 + }
  319 + }
  320 + } else if (video_id == undefined) {
  321 + let newcartlist = that.data.cartlist;
  322 + console.log(newcartlist);
  323 + for (var obj of newcartlist) {
  324 + if (obj.pic_id.id == pic_id) {
  325 + console.log(9999)
  326 + wx.showToast({
  327 + title: '已经购买过' + obj.pic_id.title,
  328 + icon: 'none'
  329 + })
  330 + }
  331 + }
  332 + }
  333 + console.log(video_id)
  334 + console.log(err.msg.msg)
  335 +
  336 +
  337 + })
  338 +
  339 +
  340 + },
  341 +
  342 + payfinish() {
  343 + let that = this;
  344 + let url = 'user/orders';
  345 + let param = {
  346 + video_id: that.data.video_id.join(","),
  347 + pic_id: that.data.pic_id.join(","),
  348 + total: that.data.totalmoney
  349 + }
  350 + app.post(url, param, 'post').then((res) => {
  351 + console.log(res);
  352 + that.setData({
  353 + order_id: res.order_id
  354 + })
  355 +
  356 +
  357 + }).catch((err) => {
  358 +
  359 + })
  360 + },
  361 +
  362 + zhifuque() {
  363 + let that = this;
  364 +
  365 + console.log(that.data.type)
  366 +
  367 + if (this.data.type == 0) {
  368 + wx.showToast({
  369 + title: '请选择支付方式',
  370 + icon: 'none'
  371 + })
  372 +
  373 + return false
  374 + }
  375 +
  376 + that.setData({
  377 + xuzhi: true,
  378 + tixian: false
  379 +
  380 + })
  381 +
  382 + // if (this.data.xieyi == false) {
  383 + // wx.showToast({
  384 + // title: '请勾选服务协议',
  385 + // icon: 'none'
  386 + // })
  387 +
  388 + // return false
  389 + // }
  390 +
  391 +
  392 +
  393 +
  394 +
  395 + },
  396 +
  397 + selxieyi() {
  398 + this.setData({
  399 + select: !this.data.select
  400 + })
  401 + },
  402 +
  403 + quezhifu() {
  404 + let that = this;
  405 + console.log(that.data.type);
  406 + console.log(that.data.select)
  407 + if (that.data.select == false) {
  408 + wx.showToast({
  409 + title: '请勾选协议内容',
  410 + icon: "none"
  411 + })
  412 +
  413 + return false
  414 + }
  415 + let url = 'pay/picpay';
  416 + let param = {
  417 + order_id: that.data.order_id,
  418 + type: that.data.type
  419 + }
  420 + app.post(url, param, 'post').then((res) => {
  421 + console.log(res);
  422 + if (that.data.type == 1) {
  423 + wx.showToast({
  424 + title: res,
  425 + icon: 'none'
  426 + })
  427 +
  428 + that.delcart()
  429 +
  430 + setTimeout(function () {
  431 + that.setData({
  432 + tixian: false
  433 + })
  434 + wx.navigateTo({
  435 + url: '/pages/orderbox/orderbox',
  436 + })
  437 + }, 1500)
  438 + } else if (that.data.type == 2) {
  439 + that.payment(res);
  440 + that.delcart()
  441 + }
  442 +
  443 +
  444 +
  445 +
  446 + }).catch((err) => {
  447 + console.log('9999', err);
  448 + console.log(err.msg.msg)
  449 + wx.showToast({
  450 + title: err.msg.msg,
  451 + icon: 'none'
  452 + })
  453 +
  454 + })
  455 +
  456 + },
  457 +
  458 +
  459 + payment(res) {
  460 + let that = this;
  461 + var timeStamp = res.timeStamp.toString();
  462 + // console.log(timeStamp);
  463 + wx.requestPayment({
  464 + timeStamp: timeStamp,
  465 + nonceStr: res.nonceStr,
  466 + package: res.package,
  467 + signType: res.signType,
  468 + paySign: res.paySign,
  469 + success: function(res) {
  470 + console.log(res)
  471 + wx.navigateTo({
  472 + url: '/pages/orderbox/orderbox',
  473 + })
  474 + },
  475 + fail: function(res) {
  476 + console.log(123);
  477 + console.log(res);
  478 + }
  479 + })
  480 + },
  481 +
  482 + delcart() {
  483 + let that = this;
  484 +
  485 + let url = 'user/delcar';
  486 + let param = {
  487 + ids: that.data.totalcartarr.join(",")
  488 + }
  489 + app.post(url, param, 'post').then((res) => {
  490 + console.log(res);
  491 +
  492 +
  493 +
  494 + }).catch((err) => {
  495 +
  496 + })
  497 +
  498 +
  499 +
  500 + },
  501 +
  502 +
  503 +
  504 + fuwuxieyi() {
  505 + wx.navigateTo({
  506 + url: '/pages/fuwuxieyi/fuwuxieyi',
  507 + })
  508 + },
  509 + /**
  510 + * 生命周期函数--监听页面初次渲染完成
  511 + */
  512 + onReady: function() {
  513 +
  514 + },
  515 +
  516 + /**
  517 + * 生命周期函数--监听页面显示
  518 + */
  519 + onShow: function() {
  520 +
  521 + },
  522 +
  523 + /**
  524 + * 生命周期函数--监听页面隐藏
  525 + */
  526 + onHide: function() {
  527 +
  528 + },
  529 +
  530 + /**
  531 + * 生命周期函数--监听页面卸载
  532 + */
  533 + onUnload: function() {
  534 +
  535 + },
  536 +
  537 + /**
  538 + * 页面相关事件处理函数--监听用户下拉动作
  539 + */
  540 + onPullDownRefresh: function() {
  541 +
  542 + },
  543 +
  544 + /**
  545 + * 页面上拉触底事件的处理函数
  546 + */
  547 + onReachBottom: function() {
  548 +
  549 + },
  550 +
  551 +
  552 + /**
  553 + * 用户点击右上角分享
  554 + */
  555 + onShareAppMessage: function() {
  556 +
  557 + }
  558 +})
  1 +{
  2 + "navigationBarTitleText": "结算"
  3 +}
  1 +<view class="xiazairegister" wx:if="{{tixian}}" bindtap="hidetixian">
  2 + <view class="selecttixian" catchtap="ti">
  3 + <view class="tixianhead">
  4 + 选择提现账户
  5 + </view>
  6 + <view class="tixianlist" wx:if="{{myinfo.is_vip==1}}">
  7 + <view class="tixianlistleft">
  8 + <view class="tixian">
  9 + <image src="/img/yueimg.png"></image>
  10 + </view>
  11 + <view class="tixianname">余额支付(当前账户余额为{{money}}元)</view>
  12 + </view>
  13 +
  14 + <view class="tixianxuan" catchtap="yuzhi">
  15 + <image src="/img/xuanze.png" wx:if="{{yu==true}}"></image>
  16 + <image src="/img/zhifuno.png" wx:else></image>
  17 + </view>
  18 + </view>
  19 + <view class="tixianlist">
  20 + <view class="tixianlistleft">
  21 + <view class="tixian">
  22 + <image src="/img/weixinimg.png"></image>
  23 + </view>
  24 + <view class="tixianname">微信支付</view>
  25 + </view>
  26 +
  27 + <view class="tixianxuan" catchtap="weizhi">
  28 + <image src="/img/xuanze.png" wx:if="{{wei==true}}"></image>
  29 + <image src="/img/zhifuno.png" wx:else></image>
  30 + </view>
  31 + </view>
  32 +
  33 + <!-- <view class="yuedu">
  34 + <view class="yueduleft" catchtap="xuanxie">
  35 + <image src="/img/duigou.png" wx:if="{{xieyi==true}}"></image>
  36 + <image src="/img/noxieyi.png" wx:else></image>
  37 + </view>
  38 + <view class="yuedutext">
  39 + <view class="yueduagree"> 我已阅读并同意</view>
  40 +
  41 + <view class="yuedujing" bindtap="fuwuxieyi">《服务协议》</view>
  42 + </view>
  43 +
  44 +
  45 + </view> -->
  46 +
  47 + <view class="queren" catchtap="zhifuque">确认</view>
  48 +
  49 + </view>
  50 +</view>
  51 +
  52 +<view wx:if="{{xuzhi==false}}">
  53 +
  54 +
  55 +<view class="minehead">
  56 + <view class="mineheadleft">
  57 + <image src='{{myinfo.avatar}}'></image>
  58 + </view>
  59 +
  60 + <view class="mineright">
  61 + <view class="minertop">
  62 + {{myinfo.nickname}}
  63 + </view>
  64 + <view class="mintbottom" wx:if="{{myinfo.is_vip==1}}">
  65 + <view class="vipimg">
  66 + <image src="/img/vipimg.png"></image>
  67 + </view>
  68 + <view class="vipmember">VIP会员</view>
  69 + </view>
  70 + </view>
  71 +</view>
  72 +
  73 +<view class="cartbigboxz">
  74 + <view class="cartbox gouwubox" wx:for="{{cartlist}}" wx:key="">
  75 +
  76 + <!-- 视频 -->
  77 + <view class="cartvideo" wx:if="{{item.video_id!=null}}">
  78 + <view class="cartbboxitem" wx:key="">
  79 +
  80 +
  81 + <view class="cartboxitemright">
  82 + <view class="videoitemimg">
  83 + <image src="{{item.video_id.thumbnail}}"></image>
  84 +
  85 + <view class="anniu">
  86 + <image src="/img/anniu.png"></image>
  87 + </view>
  88 + </view>
  89 + <view class="cartboxitembottom">
  90 + <view class="cartboxitembotleft">
  91 + {{item.video_id.title}}
  92 + </view>
  93 + <picker bindchange="bindPickerChange" value="{{index}}" range="{{item.video_id.videotype}}" data-index="{{index}}">
  94 + <view class="cartboxitemrightone">
  95 + <view class="cartbox">{{item.video_id.videotype[item.cartindex]}}</view>
  96 +
  97 + <view class="picxian"></view>
  98 +
  99 + <view class="cartxuansan">
  100 + <image src="/img/sanjiaodown.png"></image>
  101 + </view>
  102 + </view>
  103 + </picker>
  104 + </view>
  105 +
  106 + <view class="money">¥{{item.videoprice}}</view>
  107 + </view>
  108 + </view>
  109 + </view>
  110 +
  111 +
  112 + <!-- 图片 -->
  113 +
  114 + <view class="picbox" wx:if="{{item.pic_id!=null}}">
  115 + <view class="cartbboxitem" wx:key="">
  116 +
  117 + <view class="cartboxitemright">
  118 + <view class="videoitemimgp">
  119 + <image src="{{item.pic_id.thumbnail}}"></image>
  120 + </view>
  121 + <view class="cartboxitembottom">
  122 + <view class="cartboxitembotleft">
  123 + {{item.pic_id.title}}
  124 + </view>
  125 +
  126 + <!-- <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
  127 +
  128 +
  129 + <view class="cartboxitemrightone">
  130 + <view class="cartbox">{{array[index]}}</view>
  131 +
  132 + <view class="picxian"></view>
  133 +
  134 + <view class="cartxuansan">
  135 + <image src="/img/sanjiaodown.png"></image>
  136 + </view>
  137 + </view>
  138 + </picker> -->
  139 + </view>
  140 +
  141 + <view class="money" wx:if="{{item.pic_id.vipprice==undefined}}">¥{{item.pic_id.price}}</view>
  142 + <view class="money" wx:else>¥{{item.pic_id.vipprice}}</view>
  143 + </view>
  144 + </view>
  145 + </view>
  146 + </view>
  147 +</view>
  148 +
  149 +
  150 +<view class="cartfoot">
  151 + <view class="cartfootleft">
  152 +
  153 + <view class="cartfootlefthe hejisuan">
  154 + <text> 合计:¥{{totalmoney}}</text>
  155 + <text class="totaljian">共{{cartlist.length}}件</text>
  156 +
  157 + </view>
  158 + </view>
  159 +
  160 + <view class="cartfootright" bindtap="pay">支付</view>
  161 +</view>
  162 +
  163 +
  164 +</view>
  165 +
  166 +
  167 +
  168 +
  169 +<view class="buybox" wx:else>
  170 +
  171 +
  172 + <view class="text">
  173 + 亲爱的用户,您好
  174 + </view>
  175 + <view class="text">
  176 + 欢迎您购买仁甲看见SHOP素材,为了让您购买愉快,请您在购买前务必仔细阅读以下内容:
  177 + </view>
  178 + <view class="secondtitle">关于购买及售后</view>
  179 + <view class="goumiatext">您可充值仁甲看见SHOP小程序账户,通过账户余额或微信钱包进行付费购买。注册本小程序VIP会员均可享有仁甲看见SHOP所有图片/视频素材七五折优惠。购买的素材将以链接形式发送至您百度云账号,您可通过搜索我的订单查找已购买的素材链接。购买后如若您需开发票,请仔细填写个人信息,本公司按您填写的地址及时邮寄发票。</view>
  180 + <view class="secondtitle">关于版权和使用权</view>
  181 + <view class="goumiatext">您购买的素材仅限贵单位使用于本协议中的指定用途,仅拥有使用权,不包含版权及著作权等;如若在其他项目中继续使用,须联系客服更新授权书(无限次免费),以避免日后出现的侵权事件造成的不必要麻烦。</view>
  182 + <view class="secondtitle">关于物权</view>
  183 + <view class="goumiatext">此微信小程序中图片/视频涉及的拍摄目标主要针对城市景观,如果客户在使用过程中出现涉及物权纠纷的案例,本公司及小程序概不负责。如果您介意此事,请慎重下单。</view>
  184 +
  185 + <view class="secondtitle">关于素材质量</view>
  186 + <view class="goumiatext">素材拍摄使用的设备种类很多,本小程序内素材稳定性 分辨率 调色 光比等都会略有差别,建议您在下单购买之前认真查看小样,素材属于虚拟版权物品,一经售出概不接受任何理由的退换货。如果您介意此事,请慎重下单。</view>
  187 + <view class="goumiatext">我们摆上货架的商品都是仁甲看见仔细筛选和挑选的优质素材,部分航拍延时素材可能存在轻微抖动的问题,建议您在购买之前仔细查看预览视频及水印小样,以避免因为素材抖动问题带来的困扰和麻烦。如果您介意此事,请慎重下单。</view>
  188 + <view class="goumiatext">如果您在使用素材的过程中遇到其他问题或是有更好的建议请联系客服,我们会以第一时间与您沟通确保素材的正常使用。</view>
  189 + <view class="goumiatext">本制度最终解释权归山东仁甲看见影像服务有限公司所有。</view>
  190 +
  191 +
  192 + <view class="gouxuan" bindtap="selxieyi">
  193 + <view class="gouxuanleft">
  194 + <image src="/img/selectcart.png" wx:if="{{select}}"></image>
  195 + <image src="/img/noselect.png" wx:else></image>
  196 +
  197 + </view>
  198 +
  199 + <view class="gouxuanright">我已阅读该协议内容,并且同意素材售出概不退换</view>
  200 + </view>
  201 +
  202 + <view class="quebtn" bindtap="quezhifu">确定</view>
  203 +</view>
  1 +.cartbox {
  2 + padding: 24rpx;
  3 + box-sizing: border-box;
  4 + color: #5b5e63;
  5 + font-size: 28rpx;
  6 +
  7 +}
  8 +.gouwubox{
  9 + border-bottom:24rpx solid #f9f9f9
  10 +}
  11 +.cartbigboxz{
  12 + padding-bottom: 100rpx;
  13 +}
  14 +.cartbboxitem {
  15 + display: flex;
  16 + align-items: center;
  17 + /* margin-bottom: 48rpx; */
  18 +}
  19 +
  20 +.cartboxitemleft {
  21 + width: 32rpx;
  22 + height: 32rpx;
  23 + font-size: 0;
  24 +}
  25 +
  26 +.cartboxhead {
  27 + display: flex;
  28 + flex-direction: column;
  29 + justify-content: center;
  30 + align-items: flex-end;
  31 + padding: 14rpx 26rpx;
  32 + box-sizing: border-box;
  33 + border-bottom: 24rpx solid #f9f9f9;
  34 +}
  35 +
  36 +.cartboxheadright {
  37 + width: 35rpx;
  38 + height: 35rpx;
  39 + font-size: 0;
  40 + margin-right: 5rpx;
  41 +}
  42 +
  43 +.cartboxrightname {
  44 + color: #bdc4ce;
  45 + font-size: 22rpx;
  46 + margin-top: 6rpx;
  47 +}
  48 +
  49 +.videoitemimg {
  50 + width: 640rpx;
  51 + height: 360rpx;
  52 + font-size: 0;
  53 + position: relative;
  54 +}
  55 +
  56 +.videoitemimgp {
  57 + width: 640rpx;
  58 + height: 212rpx;
  59 + font-size: 0;
  60 +}
  61 +
  62 +.cartboxitemright {
  63 + margin-left: 24rpx;
  64 +}
  65 +
  66 +.cartboxitembottom {
  67 + display: flex;
  68 + align-items: center;
  69 + justify-content: space-between;
  70 + margin-top: 24rpx;
  71 +}
  72 +
  73 +.cartboxitemrightone {
  74 + display: flex;
  75 + align-items: center;
  76 + background: #f9f9f9;
  77 + height: 60rpx;
  78 + padding: 0 24rpx;
  79 + box-sizing: border-box;
  80 +}
  81 +
  82 +.cartxuansan {
  83 + width: 28rpx;
  84 + height: 30rpx;
  85 + font-size: 0;
  86 +
  87 +}
  88 +.picxian{
  89 + margin-right: 20rpx;
  90 + box-sizing: border-box
  91 +}
  92 +
  93 +.money {
  94 + color: #ea322b;
  95 + font-size: 32rpx;
  96 + font-weight: bold;
  97 + margin-top:15rpx;
  98 +}
  99 +
  100 +.cartfoot {
  101 + display: flex;
  102 + align-items: center;
  103 + justify-content: space-between;
  104 + padding: 0;
  105 + box-sizing: border-box;
  106 + height: 88rpx;
  107 + position: fixed;
  108 + bottom:0;
  109 + left:0
  110 +}
  111 +
  112 +.cartfootleft {
  113 + width: 470rpx;
  114 + height: 88rpx;
  115 + padding: 0 32rpx;
  116 + box-sizing: border-box;
  117 + display: flex;
  118 + align-items: center;
  119 + background: #fff;
  120 +}
  121 +
  122 +.cartfootlefimg {
  123 + width: 32rpx;
  124 + height: 32rpx;
  125 + font-size: 0;
  126 + margin-top: 5rpx;
  127 +}
  128 +
  129 +.cartfootlefthe {
  130 + margin-left: 24rpx;
  131 + color: #ea322b;
  132 + font-size: 28rpx;
  133 + font-weight: bold;
  134 +}
  135 +
  136 +.cartfootright {
  137 + width: 280rpx;
  138 + background: #fb6324;
  139 + font-size: 32rpx;
  140 + color: #fff;
  141 + text-align: center;
  142 + height: 88rpx;
  143 + line-height: 88rpx;
  144 +}
  145 +
  146 +.cartboxitembotleft {
  147 + color: #06121e;
  148 + font-size: 28rpx;
  149 + font-weight: bold;
  150 +}
  151 +.hejisuan{
  152 + display:flex;
  153 + align-items:center;
  154 +}
  155 +.totaljian{
  156 + color:#8C9198;
  157 + font-size: 24rpx;
  158 + font-weight: normal;
  159 + margin-left:24rpx;
  160 +}
  161 +
  162 +.selecttixian {
  163 + width: 750rpx;
  164 + height: 580rpx;
  165 + background: #fff;
  166 + position: fixed;
  167 + bottom: 0;
  168 + left: 0;
  169 + z-index: 9999;
  170 + padding: 0 24rpx;
  171 + box-sizing: border-box;
  172 +}
  173 +
  174 +.tixianhead {
  175 + padding: 24rpx 0;
  176 + box-sizing: border-box;
  177 + color: #5b5e63;
  178 + font-size: 32rpx;
  179 + border-bottom: 1rpx solid #f5f5f5;
  180 +}
  181 +
  182 +.tixianlist {
  183 + display: flex;
  184 + align-items: center;
  185 + justify-content: space-between;
  186 + padding: 34rpx 42rpx 34rpx 0;
  187 + box-sizing: border-box;
  188 + border-bottom: 1rpx solid #f5f5f5;
  189 +}
  190 +
  191 +.tixian {
  192 + width: 56rpx;
  193 + height: 60rpx;
  194 + font-size: 0;
  195 +}
  196 +
  197 +.tixianname {
  198 + color: #06121e;
  199 + font-size: 28rpx;
  200 + margin-left: 10rpx;
  201 +}
  202 +
  203 +.tixianxuan {
  204 + width: 28rpx;
  205 + height: 28rpx;
  206 + font-size: 0;
  207 +}
  208 +
  209 +.tixianlistleft {
  210 + display: flex;
  211 + align-items: center;
  212 +}
  213 +
  214 +.yuedu {
  215 + display: flex;
  216 + align-items: center;
  217 + margin-top: 35rpx;
  218 +}
  219 +
  220 +.yueduleft {
  221 + width: 40rpx;
  222 + height: 40rpx;
  223 + font-size: 0;
  224 +}
  225 +
  226 +.yuedutext {
  227 + display: flex;
  228 + align-items: center;
  229 + margin-left: 6rpx;
  230 +}
  231 +
  232 +.yueduagree {
  233 + color: #8c9198;
  234 + font-size: 24rpx;
  235 +}
  236 +
  237 +.yuedujing {
  238 + color: #fb6324;
  239 + font-size: 24rpx;
  240 +}
  241 +
  242 +.queren {
  243 + width: 702rpx;
  244 + height: 88rpx;
  245 + background: rgba(251, 99, 36, 1);
  246 + opacity: 1;
  247 + border-radius: 4rpx;
  248 + color:#fff;
  249 + font-size: 32rpx;
  250 + text-align: center;
  251 + line-height: 88rpx;
  252 + margin:20rpx auto 0;
  253 + position: fixed;
  254 + bottom:40rpx;
  255 + left:24rpx;
  256 +}
  257 +
  258 +
  259 +.mineheadleft {
  260 + width: 104rpx;
  261 + height: 104rpx;
  262 + font-size: 0;
  263 + border-radius: 50%;
  264 +}
  265 +
  266 +.mineheadleft image {
  267 + border-radius: 50%;
  268 +}
  269 +
  270 +.minebox {
  271 + padding: 32rpx 24rpx;
  272 + box-sizing: border-box;
  273 +}
  274 +
  275 +.minehead {
  276 + display: flex;
  277 + align-items: center;
  278 + padding: 32rpx 24rpx;
  279 +}
  280 +
  281 +.mintbottom {
  282 + display: flex;
  283 + align-items: center;
  284 + margin-top: 18rpx;
  285 +}
  286 +
  287 +.vipimg {
  288 + width: 32rpx;
  289 + height: 32rpx;
  290 + font-size: 0;
  291 +}
  292 +
  293 +.mineright {
  294 + margin-left: 28rpx;
  295 +}
  296 +
  297 +.minertop {
  298 + color: #06121e;
  299 + font-size: 36rpx;
  300 + font-weight: bold;
  301 +}
  302 +
  303 +.vipmember {
  304 + color: #3d444d;
  305 + font-size: 24rpx;
  306 + margin-left: 5rpx;
  307 +}
  308 +
  309 +.minebac {
  310 + width: 750rpx;
  311 + height: 350rpx;
  312 + font-size: 0;
  313 + position: relative;
  314 +}
  315 +
  316 +.minetop {
  317 + color: #ae8538;
  318 + font-size: 30rpx;
  319 + position: absolute;
  320 + top: 68rpx;
  321 + left: 64rpx;
  322 +}
  323 +
  324 +.minemoney {
  325 + color: #977434;
  326 + font-size: 52rpx;
  327 + font-weight: bold;
  328 + position: absolute;
  329 + top: 124rpx;
  330 + left: 64rpx;
  331 +}
  332 +
  333 +.mineqian {
  334 + display: flex;
  335 + align-items: center;
  336 + position: absolute;
  337 + bottom: 78rpx;
  338 + right: 56rpx;
  339 +}
  340 +
  341 +.mineqianleft {
  342 + width: 166rpx;
  343 + height: 64rpx;
  344 + background: linear-gradient(180deg, rgba(255, 253, 248, 1) 0%, rgba(255, 242, 208, 1) 100%);
  345 + opacity: 1;
  346 + border-radius: 36rpx;
  347 + color: #916e2c;
  348 + font-size: 28rpx;
  349 + text-align: center;
  350 + line-height: 64rpx;
  351 + margin-right:24rpx;
  352 +}
  353 +
  354 +.mineqianright {
  355 + width: 166rpx;
  356 + height: 64rpx;
  357 + border: 2rpx solid rgba(255, 255, 255, 1);
  358 + opacity: 1;
  359 + border-radius: 36rpx;
  360 + color:#7B6011;
  361 + font-size: 28rpx;
  362 + text-align: center;
  363 + line-height: 64rpx;
  364 +}
  365 +.minelist{
  366 + padding: 0 32rpx;
  367 + box-sizing: border-box
  368 +}
  369 +.minelsititem{
  370 + display:flex;
  371 + align-items: center;
  372 + padding: 30rpx 0;
  373 + box-sizing: border-box;
  374 + border-bottom:1rpx solid #f5f5f5;
  375 + justify-content: space-between
  376 +}
  377 +.minelistleftimg{
  378 + width:50rpx;
  379 + height:50rpx;
  380 + font-size: 0
  381 +}
  382 +.minelsititemleft{
  383 + display:flex;
  384 + align-items: center
  385 +}
  386 +.minelsitleftname{
  387 + color:#06121E;
  388 + font-size: 30rpx;
  389 + margin-left:24rpx;
  390 +
  391 +}
  392 +.mineleftright{
  393 + width:35rpx;
  394 + height:35rpx;
  395 + font-size: 0
  396 +}
  397 +.chongvip{
  398 + width:750rpx;
  399 + height:166rpx;
  400 + font-size: 0
  401 +}
  1 +// pages/jingmei/jingmei.js
  2 +var WxParse = require('../../wxParse/wxParse.js');
  3 +const app=getApp()
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + jingmeilist:[],
  11 + page:1
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function(options) {
  18 + this.getjingmei()
  19 + },
  20 +
  21 + //获取精美大片列表
  22 + getjingmei() {
  23 + let that = this;
  24 + let url = 'user/won';
  25 + let param={
  26 + page:that.data.page,
  27 + pageNum:10
  28 + }
  29 + app.post(url, param, 'post').then((res) => {
  30 + console.log(res);
  31 + that.setData({
  32 + jingmeilist: that.data.jingmeilist.concat(res)
  33 + })
  34 +
  35 + let newjingmeilist = that.data.jingmeilist;
  36 +
  37 + for (let i = 0; i < newjingmeilist.length; i++) {
  38 + console.log(i)
  39 +
  40 + WxParse.wxParse('content' + i, 'html', newjingmeilist[i]['content'], that, 5);
  41 +
  42 + if (i === newjingmeilist.length - 1) {
  43 +
  44 + WxParse.wxParseTemArray("artileList", 'content', newjingmeilist.length, that)
  45 + }
  46 + }
  47 +
  48 + that.setData({
  49 + jingmeilist:newjingmeilist
  50 + })
  51 + console.log(this.data.jingmeilist)
  52 +
  53 +
  54 + }).catch((err) => {
  55 +
  56 + })
  57 +
  58 + },
  59 + govideo(e) {
  60 + let url=e.currentTarget.dataset.url;
  61 + let thumb=e.currentTarget.dataset.thumb;
  62 + let title=e.currentTarget.dataset.title
  63 + wx.navigateTo({
  64 + url: '/pages/videoplay/videoplay?url='+url+'&thumb='+thumb+'&title='+title,
  65 + })
  66 + },
  67 + /**
  68 + * 生命周期函数--监听页面初次渲染完成
  69 + */
  70 + onReady: function() {
  71 +
  72 + },
  73 +
  74 + /**
  75 + * 生命周期函数--监听页面显示
  76 + */
  77 + onShow: function() {
  78 +
  79 + },
  80 +
  81 + /**
  82 + * 生命周期函数--监听页面隐藏
  83 + */
  84 + onHide: function() {
  85 +
  86 + },
  87 +
  88 + /**
  89 + * 生命周期函数--监听页面卸载
  90 + */
  91 + onUnload: function() {
  92 +
  93 + },
  94 +
  95 + /**
  96 + * 页面相关事件处理函数--监听用户下拉动作
  97 + */
  98 + onPullDownRefresh: function() {
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 页面上拉触底事件的处理函数
  104 + */
  105 + onReachBottom: function() {
  106 + let newpage=this.data.page;
  107 + newpage++;
  108 + this.setData({
  109 + page:newpage
  110 + })
  111 +
  112 + this.getjingmei()
  113 + },
  114 +
  115 + /**
  116 + * 用户点击右上角分享
  117 + */
  118 + onShareAppMessage: function() {
  119 +
  120 + }
  121 +})