Commit 7eeac9aa by 汪睦雄

最新版20200330 增加订单备注复制

parent 29a41bb3
// packageA/pages/home/home.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--packageA/pages/home/home.wxml-->
<text>packageA/pages/home/home.wxml</text>
/* packageA/pages/home/home.wxss */
\ No newline at end of file
let App = getApp();
import api from '../../utils/Api.js'
Page({
/**
* 页面的初始数据
*/
data: {
disabled: false,
nav_select: false, // 快捷导航
name: '',
region: '',
phone: '',
detail: '',
error: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 表单提交
*/
saveData: function(e) {
let _this = this,
values = e.detail.value
values.region = this.data.region;
// 表单验证
if (!_this.validation(values)) {
App.showError(_this.data.error);
return false;
}
// 按钮禁用
_this.setData({
disabled: true
});
api.address.add(values).then(res => {
if (res.code == 0) {
App.showSuccess(res.msg, function() {
wx.navigateBack();
});
} else {
App.showError(res.msg);
// 解除禁用
_this.setData({
disabled: false
});
}
})
},
/**
* 表单验证
*/
validation: function(values) {
if (values.name === '') {
this.data.error = '收件人不能为空';
return false;
}
if (values.phone.length < 1) {
this.data.error = '手机号不能为空';
return false;
}
// if (values.phone.length !== 11) {
// this.data.error = '手机号长度有误';
// return false;
// }
let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
if (!reg.test(values.phone)) {
this.data.error = '手机号不符合要求';
return false;
}
if (!this.data.region) {
this.data.error = '省市区不能空';
return false;
}
if (values.detail === '') {
this.data.error = '详细地址不能为空';
return false;
}
return true;
},
/**
* 修改地区
*/
bindRegionChange: function(e) {
this.setData({
region: e.detail.value[0] + ',' + e.detail.value[1] + ',' + e.detail.value[2]
})
},
/**
* 获取微信地址
*/
chooseAddress: function() {
let _this = this;
wx.chooseAddress({
success: function(res) {
_this.setData({
name: res.userName,
phone: res.telNumber,
region: res.provinceName + ',' + res.cityName + ',' + res.countyName,
detail: res.detailInfo
});
}
})
},
})
\ No newline at end of file
{
"navigationBarTitleText": "新增收货地址",
"usingComponents": {
}
}
\ No newline at end of file
<view class="container1">
<view class="common-header-xian"></view>
<!-- 表单 -->
<form bindsubmit="saveData" report-submit="true">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker mode="region" bindchange="bindRegionChange">
<text wx:if="{{region}}" class="f-30">{{region}}</text>
<text wx:else class="f-30 col-7">选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top20 profile-btn">
<button formType="submit" disabled="{{disabled}}">保存</button>
</view>
<view class="padding-box m-top35 btn-green btn-sm">
<button class="f-32" catchtap="chooseAddress">一键获取微信地址</button>
</view>
</form>
</view>
\ No newline at end of file
.container1, input {
font-family: PingFang-Medium,
PingFangSC-Regular,
Heiti,
Heiti SC,
DroidSans,
DroidSansFallback,
"Microsoft YaHei",
sans-serif;
-webkit-font-smoothing: antialiased;
}
.profile-list .admin {
padding-left: 15px;
font-size: 30rpx;
color: #333;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
width: auto;
padding: 24rpx;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
line-height: 56rpx;
display: block;
}
picker-view {
background-color: white;
padding: 0;
width: 100%;
height: 480rpx;
bottom: 0;
position: fixed;
}
picker-view-column view {
vertical-align: middle;
font-size: 28rpx;
line-height: 28rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.animation-element-wrapper {
display: flex;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
z-index: 21;
}
.animation-element {
display: flex;
position: fixed;
width: 100%;
height: 570rpx;
bottom: 0;
background-color: rgba(255, 255, 255, 1);
}
.animation-button {
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
height: 100rpx;
line-height: 100rpx;
align-items: center;
}
.address-text {
color: #999;
display: inline-flex;
position: fixed;
margin-top: 20rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
font-size: 30rpx;
font-family: Arial, Helvetica, sans-serif;
}
.left-bt {
left: 30rpx;
}
.right-bt {
right: 30rpx;
color: #ec5151;
}
.line {
display: block;
position: fixed;
height: 1rpx;
width: 100%;
margin-top: 89rpx;
background-color: #eee;
}
.address-box .right-cont input {
width: 100%;
font-size: 30rpx;
color: #444;
}
.bargain-commont-bg {
background: rgba(0, 0, 0, 0.6);
position: fixed;
right: 0;
left: 0;
top: 0;
bottom: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}
.common-header-xian {
border-top: 1rpx solid #eee;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
.b-f {
background: #fff;
}
.dis-flex {
display: flex !important;
}
.f-30 {
font-size: 30rpx;
}
.address-box .right-cont {
font-size: 30rpx;
color: #444;
}
.padding-box {
padding: 0 24rpx;
box-sizing: border-box;
}
.btn-green button {
background: #1aad19;
color: white;
}
.profile-btn button {
font-size: 34rpx;
}
.profile-btn button {
background: #2ba3d7;
color: white;
margin-bottom: 20rpx;
}
let App = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
disabled: false,
nav_select: false, // 快捷导航
region: '',
detail: {},
error: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// 获取当前地址信息
this.getAddressDetail(options.address_id);
},
/**
* 获取当前地址信息
*/
getAddressDetail: function(address_id) {
let _this = this;
App._get('address/detail', {
address_id
}, function(result) {
_this.setData(result.data);
});
},
/**
* 表单提交
*/
saveData: function(e) {
let _this = this,
values = e.detail.value
values.region = this.data.region;
// 记录formId
App.saveFormId(e.detail.formId);
// 表单验证
if (!_this.validation(values)) {
App.showError(_this.data.error);
return false;
}
// 按钮禁用
_this.setData({
disabled: true
});
// 提交到后端
values.address_id = _this.data.detail.address_id;
App._post_form('address/edit', values, function(result) {
App.showSuccess(result.msg, function() {
wx.navigateBack();
});
}, false, function() {
// 解除禁用
_this.setData({
disabled: false
});
});
},
/**
* 表单验证
*/
validation: function(values) {
if (values.name === '') {
this.data.error = '收件人不能为空';
return false;
}
if (values.phone.length < 1) {
this.data.error = '手机号不能为空';
return false;
}
// if (values.phone.length !== 11) {
// this.data.error = '手机号长度有误';
// return false;
// }
let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
if (!reg.test(values.phone)) {
this.data.error = '手机号不符合要求';
return false;
}
if (!this.data.region) {
this.data.error = '省市区不能空';
return false;
}
if (values.detail === '') {
this.data.error = '详细地址不能为空';
return false;
}
return true;
},
/**
* 修改地区
*/
bindRegionChange: function(e) {
this.setData({
region: e.detail.value
})
},
/**
* 获取微信地址
*/
chooseAddress: function() {
let _this = this;
wx.chooseAddress({
success: function(res) {
_this.setData({
'detail.name': res.userName,
'detail.phone': res.telNumber,
'detail.detail': res.detailInfo,
region: [res.provinceName, res.cityName, res.countyName],
});
}
})
},
})
\ No newline at end of file
{
"navigationBarTitleText": "编辑收货地址",
"usingComponents": {
}
}
\ No newline at end of file
<view class="container">
<view class="common-header-xian"></view>
<!-- 表单 -->
<form bindsubmit="saveData" report-submit="true">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{detail.name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{detail.phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker mode="region" bindchange="bindRegionChange" value="{{ region }}">
<text wx:if="{{ region.length }}" class="f-30">{{ region }}</text>
<text wx:else class="f-30 col-7">选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail.detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top35 btn-green btn-sm">
<button class="f-32" catchtap="chooseAddress">一键获取微信地址</button>
</view>
<view class="padding-box m-top20 profile-btn">
<button formType="submit" disabled="{{disabled}}">保存</button>
</view>
</form>
</view>
\ No newline at end of file
.profile-list .admin {
padding-left: 15px;
font-size: 30rpx;
color: #333;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
width: auto;
padding: 24rpx;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
line-height: 56rpx;
display: block;
}
picker-view {
background-color: white;
padding: 0;
width: 100%;
height: 480rpx;
bottom: 0;
position: fixed;
}
picker-view-column view {
vertical-align: middle;
font-size: 28rpx;
line-height: 28rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.animation-element-wrapper {
display: flex;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
z-index: 21;
}
.animation-element {
display: flex;
position: fixed;
width: 100%;
height: 570rpx;
bottom: 0;
background-color: rgba(255, 255, 255, 1);
}
.animation-button {
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
height: 100rpx;
line-height: 100rpx;
align-items: center;
}
.address-text {
color: #999;
display: inline-flex;
position: fixed;
margin-top: 20rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
font-size: 30rpx;
font-family: Arial, Helvetica, sans-serif;
}
.left-bt {
left: 30rpx;
}
.right-bt {
right: 30rpx;
color: #ec5151;
}
.line {
display: block;
position: fixed;
height: 1rpx;
width: 100%;
margin-top: 89rpx;
background-color: #eee;
}
.address-box .right-cont input {
width: 100%;
font-size: 30rpx;
color: #444;
}
.bargain-commont-bg {
background: rgba(0, 0, 0, 0.6);
position: fixed;
right: 0;
left: 0;
top: 0;
bottom: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}
let App = getApp();
import api from '../../utils/Api.js'
Page({
data: {
list: [],
default_id: null,
},
onLoad: function(options) {
// 当前页面参数
this.data.options = options;
},
onShow: function() {
// 获取收货地址列表
this.getAddressList();
},
/**
* 获取收货地址列表
*/
getAddressList: function() {
let _this = this;
api.address.lists().then(res => {
if (res.code == 0) {
_this.setData(res.data);
} else {
wx.showToast({
title: '没有更多了',
icon: 'none'
})
}
})
},
/**
* 添加新地址
*/
createAddress: function() {
wx.navigateTo({
url: './create'
});
},
/**
* 编辑地址
*/
editAddress: function(e) {
wx.navigateTo({
url: "./detail?address_id=" + e.currentTarget.dataset.id
});
},
/**
* 移除收货地址
*/
removeAddress: function(e) {
let _this = this,
address_id = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "您确定要移除当前收货地址吗?",
success: function(o) {
o.confirm && api.address.deleteAddr({
address_id: address_id
}).then(res => {
_this.getAddressList();
})
}
});
},
/**
* 设置为默认地址
*/
setDefault: function(e) {
let _this = this,
address_id = e.detail.value;
_this.setData({
default_id: parseInt(address_id)
});
api.address.setDefault({
address_id: address_id
}).then(res => {
if (res.code == 0) {
_this.data.options.from === 'flow' && wx.navigateBack();
} else {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
return false;
},
});
\ No newline at end of file
{
"navigationBarTitleText": "收货地址",
"usingComponents": {
}
}
\ No newline at end of file
<view class="container1 m-b6 p-bottom">
<view class="common-header-xian"></view>
<custom-ul class="addres-list" wx:if="{{list.length}}">
<custom-li wx:for="{{list}}" wx:for-item="item" wx:key="this">
<view class="address-header b-f m-top18">
<view class="flow-header-left pl-12">
<view class="flow-checkout-admin">{{item.name}}
<text>{{item.phone}}</text>
</view>
<view class="flow-checkout-address">
{{item.region.province}} {{item.region.city}} {{item.region.region}} {{item.detail}}
</view>
</view>
</view>
<view class="address-list dis-flex b-f">
<view class="list address-left">
<radio-group bindchange="setDefault" class="radio-group">
<label class="radio">
<radio checked="{{item.address_id == default_id}}" color="#ff495e" value="{{item.address_id}}"></radio>
<text class="cont" wx:if="{{item.address_id == default_id}}">默认</text>
<text class="cont" wx:else>选择</text>
</label>
</radio-group>
</view>
<view class="list address-right dis-flex">
<!-- <view bindtap="editAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-edit"></text>
<text class="title">编辑</text>
</view> -->
<view bindtap="removeAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-lajixiang"></text>
<text class="title">删除</text>
</view>
</view>
</view>
</custom-li>
</custom-ul>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-wushuju"></text>
<text class="cont">亲,您还没有收货地址</text>
</view>
</view>
<view class="footer-fixed f-32">
<view bindtap="createAddress" class="order-bt" style="width:100%">添加新地址</view>
</view>
</view>
\ No newline at end of file
page {
background: #f7f7f7;
}
.container1, input {
-webkit-font-smoothing: antialiased;
}
.p-bottom {
padding-bottom: 112rpx;
}
.common-header-xian {
border-top: 1rpx solid #eee;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
.flow-list .header .shop_name {
padding-left: 10rpx;
font-size: 30rpx;
color: #333;
}
.flow-list .header image {
width: 34rpx;
height: 37rpx;
position: absolute;
top: 50%;
margin-top: -18rpx;
left: 15px;
}
.flow-list .header {
background: #fdf9f9;
padding: 24rpx 0;
border-top: 1rpx solid #eee;
border-bottom: 1rpx solid #eee;
font-size: 30rpx;
position: relative;
}
.flow-list custom-li, .addres-list custom-li {
margin-top: 25rpx;
display: block;
background: #fff;
}
.flow-list custom-li:first-child, .addres-list custom-li:first-child {
margin-top: 0;
}
.flow-distribution-right .icon-xiangyoujiantou {
font-size: 26rpx;
position: absolute;
right: 15px;
top: 50%;
margin-top: -16rpx;
color: #999;
}
.dis-flex {
display: flex !important;
}
.address-list {
border-bottom: 1px solid #f6f6f9;
}
.address-list .list {
padding: 15rpx;
}
.address-list .list .title {
font-size: 30rpx;
padding: 0 24rpx 0 6rpx;
color: #666;
}
.address-list .list .cont {
font-size: 30rpx;
color: #333;
}
.address-list .list navigator {
display: inline-block;
}
.address-list .list image {
width: 28rpx;
height: 28rpx;
}
.address-left {
flex: 6;
}
.address-right {
flex: 2.2;
display: flex;
justify-content: flex-end;
}
.address-right .iconfont {
color: #777;
font-size: 30rpx;
}
.flow-fixed-footer {
position: fixed;
bottom: 0;
width: 100%;
background: #2ba3d7;
z-index: 4999;
}
.flow-fixed-footer .chackout-left {
font-size: 32rpx;
line-height: 44px;
color: #777;
}
.flow-fixed-footer .chackout-right {
font-size: 34rpx;
}
.address-header {
padding: 28rpx 0;
border-bottom: 1px solid #f6f6f9;
background-size: 120rpx auto;
font-size: 1.7rem;
}
.flow-header-left {
flex: 14;
padding: 0rpx 20rpx;
}
.flow-header-right {
flex: 1;
}
.flow-header-right image {
width: 34rpx;
height: 34rpx;
margin-top: 20rpx;
float: right;
}
.address-header .flow-checkout-admin {
font-size: 34rpx;
color: #444;
}
.address-header .flow-checkout-admin text {
padding: 0 10rpx;
}
.address-header .flow-checkout-address {
font-size: 26rpx;
color: #777;
margin-top: 6rpx;
}
.radio-group raido {
color: #2ba3d7;
}
.footer-fixed {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
display: flex;
height: 92rpx;
z-index: 11;
box-shadow: 0 -2px 20px 0 rgba(144, 52, 52, 0.1);
background: #fff;
}
.order-bt {
width: 50%;
background-image: linear-gradient(90deg, #2ba3d7, #2ba3d7);
color: #fff;
text-align: center;
line-height: 92rpx;
font-size: 30rpx;
}
.yoshop-notcont {
text-align: center;
padding: 100rpx;
}
// pages/live.js
import api from '../../utils/Api.js'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
rooms: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getLiveRooms();
},
// 获取个人资料
getLiveRooms: function(callback) {
api.live.rooms().then(res => {
if (!res.code) {
// 渲染数据
this.setData({
rooms: res.data
})
this.getLiveStatus()
}
typeof callback == "function" && callback()
})
},
// 获取直播室状态
getLiveStatus: function() {
console.log('liveStatus')
let that = this
// 引入获取直播状态接口
let livePlayer = requirePlugin('live-player-plugin')
// 首次获取立马返回直播状态,往后间隔1分钟或更慢的频率去轮询获取直播状态
let rooms = that.data.rooms
for (let i = 0; i < rooms.length; i++) {
livePlayer.getLiveStatus({
room_id: rooms[i].roomid
})
.then(res => {
// 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常, 107:已过期
const liveStatus = res.liveStatus
if (liveStatus == 101) {
rooms[i].live_status_text = '直播中'
} else if (liveStatus == 102) {
rooms[i].live_status_text = '未开始'
} else if (liveStatus == 103) {
rooms[i].live_status_text = '已结束'
} else if (liveStatus == 104) {
rooms[i].live_status_text = '禁播'
} else if (liveStatus == 105) {
rooms[i].live_status_text = '暂停中'
} else if (liveStatus == 106) {
rooms[i].live_status_text = '异常'
} else if (liveStatus == 107) {
rooms[i].live_status_text = '已过期'
}
that.updateLiveStatus(rooms[i].roomid, rooms[i].live_status_text)
})
.catch(err => {
console.log(err)
})
}
},
updateLiveStatus: function(rid, status) {
let rooms = this.data.rooms
for (let i = 0; i < rooms.length; i++) {
if (rooms[i].roomid == rid) {
rooms[i].live_status_text = status
break
}
}
this.setData({
rooms: rooms
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
wx.showNavigationBarLoading()
this.getLiveRooms(() => {
wx.hideNavigationBarLoading()
wx.stopPullDownRefresh()
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "美行者直播",
"backgroundColor": "#f5f5f5",
"enablePullDownRefresh": true,
"usingComponents": {
"i-cell-group": "/iview/cell-group/index",
"i-cell": "/iview/cell/index",
"i-row": "/iview/row/index",
"i-col": "/iview/col/index"
}
}
\ No newline at end of file
<!--pages/live.wxml-->
<view class="v-page">
<i-cell-group i-class="section-wrapper">
<i-cell title="直播列表" i-class="text-mtitle">
<text slot="footer" class='text-gray text-small' data-name='直播列表'></text>
</i-cell>
<i-row i-class="col-wrapper">
<i-col span="12" i-class="col-class" wx:for="{{rooms}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<navigator url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id={{n.roomid}}">
<view class='col-item' data-roomid='{{n.roomid}}'>
<image class='image' src="{{n.cover_img}}" mode='aspectFill'></image>
<view class='title'>{{n.name}}</view>
<view class='info'>
<view class="author">
<image class='avatar-image' src="{{n.anchor_img}}" mode='aspectFill'></image>
<text>{{n.anchor_name}}</text>
</view>
<text>{{n.live_status_text}}</text>
</view>
</view>
</navigator>
</i-col>
</i-row>
</i-cell-group>
</view>
\ No newline at end of file
/* pages/live.wxss */
.v-page {
position: relative;
}
.section-wrapper {
margin-top: 10px;
background-color: #fff;
padding-bottom: 10px;
}
.col-wrapper {
padding: 0 7px;
position: relative;
}
.text-mtitle {
font-size: 16px;
font-weight: bolder;
}
.col-class {
padding: 0 7px;
position: relative;
margin-bottom: 7px;
}
.col-item {
position: relative;
border: 1px solid #eee;
padding-bottom: 10px;
box-sizing: border-box;
}
.col-item .image {
width: 100%;
height: 180px;
}
.col-item .info {
font-size: 12px;
color: rgb(255, 68, 0);
margin-top: 2px;
padding-left: 20rpx;
padding-right: 20rpx;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
.author{
display: flex;
flex-flow: row nowrap;
align-items: center;
}
.author text{
color: #353535;
margin-left: 10rpx;
}
.col-item .avatar-image {
width: 40rpx;
height: 40rpx;
border-radius: 20rpx;
}
.col-item .title {
text-align: center;
font-size: 12px;
color: rgb(51, 51, 51);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 2px 2px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment