Kaynağa Gözat

【新增直播频道】

livetest
刘晖 5 yıl önce
ebeveyn
işleme
a088834c9a
4 değiştirilmiş dosya ile 390 ekleme ve 364 silme
  1. +117
    -117
      app.json
  2. +6
    -0
      ext.json
  3. +258
    -247
      index/user.js
  4. +9
    -0
      index/user.wxml

+ 117
- 117
app.json Dosyayı Görüntüle

@@ -1,119 +1,119 @@
{
"pages": [
"pages/index/index",
"index/index",
"index/searchbar",
"index/passCar",
"index/user",
"pages/searchbar/searchbar",
"pages/integralmall/integraHistory/index",
"pages/integralmall/payIntegcouponStatus/index",
"pages/integralmall/payIntegcoupondetail/index",
"pages/joinFrDpell/index",
"pages/spellDetail/index",
"pages/radetail/success/index",
"pages/spellTimeout/index",
"pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup",
"pages/complete/index",
"pages/topicDetail/index",
"pages/acSignIn/index",
"pages/index/merchantList/index",
"pages/index/searchbar/detail/index",
"pages/bargain/bargainDatail/bargainDatail",
"pages/bargain/bargain",
"pages/cardorder/index/index",
"pages/scanPay/scanPay",
"pages/edit/edit",
"pages/radetail/index",
"pages/radetail/joinActivity/edit",
"pages/bannerdetail/index",
"pages/getuserinfo/index",
"pages/phoneinput/phoneinput",
"pages/user/myactivity/index",
"pages/coupon/detail/index",
"pages/rushToBuy/index",
"pages/couponorder/index/index",
"pages/couponorder/detail/index",
"pages/cardorder/detail/index",
"pages/cardorder/userule/userule",
"pages/order/detail/index",
"pages/order/index/index",
"pages/ques/ques",
"pages/getphoneInfo/index",
"pages/addPark/addPark",
"pages/orderquanma/index",
"pages/passCar/couponList/couponList",
"pages/passCar/couponDetail/couponDetail",
"pages/managelicenseplate/managelicenseplate",
"pages/payrule/payrule",
"pages/grade/grade",
"pages/exchange/exchange",
"pages/game/index",
"pages/canvas/index",
"pages/specialcourtesy/specialcourtesy",
"pages/discountCardList/discountCardList",
"pages/cardListDetail/cardListDetail",
"pages/freeBannerDetail/index",
"pages/paySuccess/paySuccess",
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index",
"pages/czdetail/czdetail",
"pages/spellGroup/paySpellGroup/index",
"pages/integralmall/index",
"pages/mallInfo/mallInfo"
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",
"wxc07f9d67923d676d",
"wxbd08b4baa10fcc1d"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"tabBar": {
"custom": true,
"list": [
{
"pagePath": "index/index",
"iconPath": "assets/images/home.png",
"selectedIconPath": "assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "index/searchbar",
"iconPath": "assets/images/mendian.png",
"selectedIconPath": "assets/images/mendian-a.png",
"text": "门店"
},
{
"pagePath": "index/passCar",
"iconPath": "assets/images/park.png",
"selectedIconPath": "assets/images/park-a.png",
"text": "停车"
},
{
"pagePath": "index/user",
"iconPath": "assets/images/user.png",
"selectedIconPath": "assets/images/user-a.png",
"text": "我的"
}
]
},
"usingComponents": {},
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
},
"debug": false,
"sitemapLocation": "sitemap.json"
"pages": [
"pages/index/index",
"index/index",
"index/searchbar",
"index/passCar",
"index/user",
"pages/searchbar/searchbar",
"pages/integralmall/integraHistory/index",
"pages/integralmall/payIntegcouponStatus/index",
"pages/integralmall/payIntegcoupondetail/index",
"pages/joinFrDpell/index",
"pages/spellDetail/index",
"pages/radetail/success/index",
"pages/spellTimeout/index",
"pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup",
"pages/complete/index",
"pages/topicDetail/index",
"pages/acSignIn/index",
"pages/index/merchantList/index",
"pages/index/searchbar/detail/index",
"pages/bargain/bargainDatail/bargainDatail",
"pages/bargain/bargain",
"pages/cardorder/index/index",
"pages/scanPay/scanPay",
"pages/edit/edit",
"pages/radetail/index",
"pages/radetail/joinActivity/edit",
"pages/bannerdetail/index",
"pages/getuserinfo/index",
"pages/phoneinput/phoneinput",
"pages/user/myactivity/index",
"pages/coupon/detail/index",
"pages/rushToBuy/index",
"pages/couponorder/index/index",
"pages/couponorder/detail/index",
"pages/cardorder/detail/index",
"pages/cardorder/userule/userule",
"pages/order/detail/index",
"pages/order/index/index",
"pages/ques/ques",
"pages/getphoneInfo/index",
"pages/addPark/addPark",
"pages/orderquanma/index",
"pages/passCar/couponList/couponList",
"pages/passCar/couponDetail/couponDetail",
"pages/managelicenseplate/managelicenseplate",
"pages/payrule/payrule",
"pages/grade/grade",
"pages/exchange/exchange",
"pages/game/index",
"pages/canvas/index",
"pages/specialcourtesy/specialcourtesy",
"pages/discountCardList/discountCardList",
"pages/cardListDetail/cardListDetail",
"pages/freeBannerDetail/index",
"pages/paySuccess/paySuccess",
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index",
"pages/czdetail/czdetail",
"pages/spellGroup/paySpellGroup/index",
"pages/integralmall/index",
"pages/mallInfo/mallInfo"
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",
"wxc07f9d67923d676d",
"wxbd08b4baa10fcc1d"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"tabBar": {
"custom": true,
"list": [
{
"pagePath": "index/index",
"iconPath": "assets/images/home.png",
"selectedIconPath": "assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "index/searchbar",
"iconPath": "assets/images/mendian.png",
"selectedIconPath": "assets/images/mendian-a.png",
"text": "门店"
},
{
"pagePath": "index/passCar",
"iconPath": "assets/images/park.png",
"selectedIconPath": "assets/images/park-a.png",
"text": "停车"
},
{
"pagePath": "index/user",
"iconPath": "assets/images/user.png",
"selectedIconPath": "assets/images/user-a.png",
"text": "我的"
}
]
},
"usingComponents": {},
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
},
"debug": false,
"sitemapLocation": "sitemap.json"
}

+ 6
- 0
ext.json Dosyayı Görüntüle

@@ -26,6 +26,12 @@
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0"
},
"plugins": {
"live-player-plugin": {
"version": "1.0.11",
"provider": "wx2b03c6e691cd7370"
}
},
"debug": false,
"tabBar": {
"list": [


+ 258
- 247
index/user.js Dosyayı Görüntüle

@@ -7,266 +7,277 @@ const imgurl = require("../utils/imgurl");
var config = require("../config/config.js");
const bgColor = require("../utils/bgColor.js")
Page({
/**
* 页面的初始数据
*/
data: {
aboutShow:false,
navigationBarHeight,
ifStoreApp:ifStoreApp,
aboutUs: imgurl.aboutUs.url,
banneColor: bgColor.colorFirst.user.banneColor,
levelBg: bgColor.colorFirst.user.levelBg,
view: bgColor.colorFirst.user.view,
redirectUrl: imgurl.redirect.url,
editUrl: imgurl.edit.url,
activeUrl: imgurl.active.url,
dingUrl: imgurl.ding.url,
duihuan: imgurl.duihuan.url,
quansUrl: imgurl.quans.url,
wmintegral: imgurl.wmintegral.url,
cardiconUrl: imgurl.cardicon.url,
myactivitygift: imgurl.myactivitygift.url,
myactivity: imgurl.myactivity.url,
cheUrl: imgurl.che.url,
giftUrl: imgurl.gift.url,
wmbarginicon: imgurl.wmbarginicon.url,
wmspellgroup: imgurl.wmspellgroup.url,
canIUse: wx.canIUse('official-account'),
mineFlag:"",
flag: 'hidden',
score: '0',
name: "",
birthdate: "",
sex: "",
showEdit: false,
ismember: false,
canvasHidden: false,
maskHidden: true,
imagePath: '',
appVersion: "",
placeholder: ''
},
checkUserStatus() {
let that = this;
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
wx.navigateTo({
url: '/pages/edit/edit',
})
}).catch(err => {
wx.navigateTo({
url: `/pages/getphoneInfo/index?mineFlag=mine`,
})
})
},
/**
* 跳转到成长值的页面
*/
gotograde: function() {
wx.navigateTo({
url: '/pages/czdetail/czdetail',
})
},
/**
* 跳转到商场信息的页面
*/
gomallInfo: function () {
wx.navigateTo({
url: '/pages/mallInfo/mallInfo',
})
},
showVersion: function() {
/**
* 长按显示版本号
* 页面的初始数据
*/
let that = this;
if (that.data.flag == 'hidden') {
that.setData({
flag: 'show'
});
}
},
gotoedit: function() {
this.checkUserStatus();
},
onLoad() {
this.getLocation();
this.updateScene();
},
/**
* 获得经纬度
*/
getLocation() {
let that = this;
wx.getLocation({
type: "wgs84",
success: function(res) {
console.log(res)
if (res && res.longitude && res.latitude) {
Http.post({
url: config.api.updateLBS,
data: {
latitude: res.latitude,
longitude: res.longitude
}
}).then(res => {
console.log(res)
})
data: {
aboutShow: false,
navigationBarHeight,
ifStoreApp: ifStoreApp,
aboutUs: imgurl.aboutUs.url,
banneColor: bgColor.colorFirst.user.banneColor,
levelBg: bgColor.colorFirst.user.levelBg,
view: bgColor.colorFirst.user.view,
redirectUrl: imgurl.redirect.url,
editUrl: imgurl.edit.url,
activeUrl: imgurl.active.url,
dingUrl: imgurl.ding.url,
duihuan: imgurl.duihuan.url,
quansUrl: imgurl.quans.url,
wmintegral: imgurl.wmintegral.url,
cardiconUrl: imgurl.cardicon.url,
myactivitygift: imgurl.myactivitygift.url,
myactivity: imgurl.myactivity.url,
cheUrl: imgurl.che.url,
giftUrl: imgurl.gift.url,
wmbarginicon: imgurl.wmbarginicon.url,
wmspellgroup: imgurl.wmspellgroup.url,
canIUse: wx.canIUse('official-account'),
mineFlag: "",
flag: 'hidden',
score: '0',
name: "",
birthdate: "",
sex: "",
showEdit: false,
ismember: false,
canvasHidden: false,
maskHidden: true,
imagePath: '',
appVersion: "",
placeholder: ''
},
checkUserStatus() {
let that = this;
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
wx.navigateTo({
url: '/pages/edit/edit',
})
}).catch(err => {
wx.navigateTo({
url: `/pages/getphoneInfo/index?mineFlag=mine`,
})
})
},
/**
* 跳转到成长值的页面
*/
gotograde: function () {
wx.navigateTo({
url: '/pages/czdetail/czdetail',
})
},
/**
* 跳转到商场信息的页面
*/
gomallInfo: function () {
wx.navigateTo({
url: '/pages/mallInfo/mallInfo',
})
},
showVersion: function () {
/**
* 长按显示版本号
*/
let that = this;
if (that.data.flag == 'hidden') {
that.setData({
flag: 'show'
});
}
},
fail: error => {
console.log(error);
}
})
},
/**
* 用户更新scene
*/
updateScene(){
Http.post({
url: config.api.updateScene,
data: {
scene: app.globalData.scene
}
}).then(res => {
console.log(res)
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this;
if (typeof that.getTabBar === 'function' &&
that.getTabBar()) {
if (ifStoreApp==1){
that.getTabBar().setData({
selected: 1
},
gotoedit: function () {
this.checkUserStatus();
},
onLoad() {
this.getLocation();
this.updateScene();
this.getRoomId();
console.log(wx.getExtConfigSync())
},
getRoomId() {
let roomId = [3] // 填写具体的房间号,可通过下面【获取直播房间列表】 API 获取
let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 })) // 开发者在直播间页面路径上携带自定义参数(如示例中的path和pid参数),后续可以在分享卡片链接和跳转至商详页时获取,详见【获取自定义参数】、【直播间到商详页面携带参数】章节(上限600个字符,超过部分会被截断)
console.log(customParams,777777777)
this.setData({
roomId,
customParams
})
} else if(ifStoreApp == 2){
that.getTabBar().setData({
selected: 2
},
/**
* 获得经纬度
*/
getLocation() {
let that = this;
wx.getLocation({
type: "wgs84",
success: function (res) {
console.log(res)
if (res && res.longitude && res.latitude) {
Http.post({
url: config.api.updateLBS,
data: {
latitude: res.latitude,
longitude: res.longitude
}
}).then(res => {
console.log(res)
})
}
},
fail: error => {
console.log(error);
}
})
}else{
that.getTabBar().setData({
selected: 3
},
/**
* 用户更新scene
*/
updateScene() {
Http.post({
url: config.api.updateScene,
data: {
scene: app.globalData.scene
}
}).then(res => {
console.log(res)
})
}
}
that.setData({
appVersion: extConfig.appVersion,
})
},
/**
* couponNum
* couponNum2
* 生命周期函数--监听页面显示
*/
let num = wx.getStorageSync('couponNum');
let num1 = wx.getStorageSync('couponNum2');
wx.hideTabBarRedDot({
index: 3
});
if (num == 'couponNum1') {
wx.setStorage({
key: 'couponNum',
data: "couponNum1",
})
that.setData({
couponNum: "couponNum1"
})
} else if (num == 'couponNum') {
that.setData({
couponNum: "couponNum"
})
};
if (num1 == 'couponNum3') {
wx.setStorage({
key: 'couponNum2',
data: "couponNum3",
})
that.setData({
couponNum2: "couponNum3"
})
} else if (num1 == 'couponNum2') {
that.setData({
couponNum2: "couponNum2"
});
};
Http.get({
url: config.api.getScore,
data: {}
}).then(res => {
if (res.data.address && res.data.name && res.data.sex && res.data.birthdate) {
that.setData({
showEdit: true
})
onShow: function () {
let that = this;
if (typeof that.getTabBar === 'function' &&
that.getTabBar()) {
if (ifStoreApp == 1) {
that.getTabBar().setData({
selected: 1
})
} else if (ifStoreApp == 2) {
that.getTabBar().setData({
selected: 2
})
} else {
that.getTabBar().setData({
selected: 3
})
}

}
that.setData({
score: res.data.score,
levelName: res.data.levelName,
appVersion: extConfig.appVersion,
})
if (res.data.nickName) {
that.setData({
ismember: true,
memberId: res.data.id
})
var size = this.setCanvasSize();
var initUrl = JSON.stringify({
flagid: res.data.id
});
}
})
.catch(err => {
wx.showModal({
title: '提示',
content: err.errMsg,
showCancel: false
/**
* couponNum
* couponNum2
*/
let num = wx.getStorageSync('couponNum');
let num1 = wx.getStorageSync('couponNum2');
wx.hideTabBarRedDot({
index: 3
});
if (num == 'couponNum1') {
wx.setStorage({
key: 'couponNum',
data: "couponNum1",
})
that.setData({
couponNum: "couponNum1"
})
} else if (num == 'couponNum') {
that.setData({
couponNum: "couponNum"
})
};
if (num1 == 'couponNum3') {
wx.setStorage({
key: 'couponNum2',
data: "couponNum3",
})
that.setData({
couponNum2: "couponNum3"
})
} else if (num1 == 'couponNum2') {
that.setData({
couponNum2: "couponNum2"
});
};

Http.get({
url: config.api.getScore,
data: {}
}).then(res => {
if (res.data.address && res.data.name && res.data.sex && res.data.birthdate) {
that.setData({
showEdit: true
})
}
that.setData({
score: res.data.score,
levelName: res.data.levelName,
})
if (res.data.nickName) {
that.setData({
ismember: true,
memberId: res.data.id
})
var size = this.setCanvasSize();
var initUrl = JSON.stringify({
flagid: res.data.id
});
}
})
})
//暂时注释
// that.getrun();
.catch(err => {
wx.showModal({
title: '提示',
content: err.errMsg,
showCancel: false
})
})
//暂时注释
// that.getrun();


//查询关于我们
Http.get({
url: config.api.getMallInfo,
data: {}
}).then(res => {
console.log(res)
if (res.data.businessHours !=='[]') {
that.setData({
aboutShow: true
})
}else{
that.setData({
aboutShow: false
//查询关于我们
Http.get({
url: config.api.getMallInfo,
data: {}
}).then(res => {
console.log(res)
if (res.data.businessHours !== '[]') {
that.setData({
aboutShow: true
})
} else {
that.setData({
aboutShow: false
})
}
})
}
})
.catch(err => {
})
},
//适配不同屏幕大小的canvas
setCanvasSize: function() {
var size = {};
try {
var res = wx.getSystemInfoSync();
var scale = 750 / 500;
//不同屏幕下canvas的适配比例;设计稿是750宽
var width = res.windowWidth / scale;
var height = width;
//canvas画布为正方形
size.w = width;
size.h = height;
} catch (e) {
// Do something when catch error
console.log("获取设备信息失败" + e);
}
return size;
},
.catch(err => {
})
},
//适配不同屏幕大小的canvas
setCanvasSize: function () {
var size = {};
try {
var res = wx.getSystemInfoSync();
var scale = 750 / 500;
//不同屏幕下canvas的适配比例;设计稿是750宽
var width = res.windowWidth / scale;
var height = width;
//canvas画布为正方形
size.w = width;
size.h = height;
} catch (e) {
// Do something when catch error
console.log("获取设备信息失败" + e);
}
return size;
},

});

+ 9
- 0
index/user.wxml Dosyayı Görüntüle

@@ -55,6 +55,15 @@
</view>
</view>
</navigator>
<navigator url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{roomId}}&custom_params={{customParams}}">
<view class="user-btn app-border-bottom">
<view>
<image class='icons' src="{{cardiconUrl}}" mode='widthFix'></image>直播</view>
<view>
<text class="couponnum" wx:if="{{couponNum2=='couponNum2'}}"></text>
</view>
</view>
</navigator>
</view>
</view>
</view>


Yükleniyor…
İptal
Kaydet