银花优选微信小程序修改后的最新版本代码

This commit is contained in:
ss001
2026-02-07 16:22:31 +08:00
commit c00caf5744
516 changed files with 41796 additions and 0 deletions

1254
pages/appbusiness/index.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "申请线下商家"
}

View File

@@ -0,0 +1,191 @@
<import src="../../wxParse/wxParse.wxml"/>
<view class="container">
<form bindsubmit='saveaddress' wx:if="{{uid>68}}">
<view class="myaddress-box">
<view class="frombody" wx:if="{{byNumber==0}}">
<view style="font-weight: 800;color:#ff4d00;">
请仔细填写、需提交三方审核
</view>
<view style="font-weight: 800;">
第一步:填写商家资料
</view>
<view class="area">
<picker class="picker_hx" name="picker_hx0" value="{{clslist[hc_index].id}}" data-selecthx="{{clslist[hc_index].name}}" range="{{clslist}}" range-key="{{'name'}}" bindchange="clsChange">
<text>商家分类:</text><input name="sjfl" type="text" disabled="disabled" placeholder="请选择商家分类" value="{{clsname}}"/><image src="../../images/icon-arrowdown.png"></image>
</picker>
</view>
<view>
<text>商家名称:</text><input name="txtName" type="text" placeholder="请填写商家名称" value="{{sjname}}" />
</view>
<view>
<text>商家让利:</text><input name="txtylmoney" type="text" placeholder="请填写商家让利({{ylmoney}}-{{ylmoney0}}" value="{{ylmoney}}" bindinput='getylmoney' /><text>%</text>
</view>
<view>
<text>信用代码:</text><input name="txtnumber" type="text" placeholder="请填写统一社会信用代码" value="{{number}}" />
</view>
<view>
<text>对公账号:</text><input name="txtdgzh" type="text" placeholder="没有可留空" value="{{dgzh}}" />
</view>
<view>
<text>法人姓名:</text><input name="txtfrname" type="text" placeholder="请填写公司法人姓名" value="{{frname}}" />
</view>
<view>
<text style="width: 7em;">法人身份证号:</text><input name="txtfridcard" type="text" placeholder="请填写法人身份证号码" value="{{fridcard}}" />
</view>
<view>
<text>联系电话:</text><input name="txttel" type="text" placeholder="请填写联系电话" value="{{tel}}" />
</view>
<view class="upimage_box" style="border-bottom: 0;">
<text>门头照片:</text><view class="image"><image src='{{sjimage0}}' bindtap="onsjimage" data-id="0"></image>
<!--<image src='{{sjimage5}}' bindtap="onsjimage" data-id="5"></image><image src='{{sjimage6}}' bindtap="onsjimage" data-id="6"></image>-->
</view>
</view>
<!--<view style="color:#848484">
最多可上传3张预览图片
</view>-->
<view class="upimage0_box">
<view class="upimage0_title">上传证件:</view>
<view class="upimage0_box_to">
<view class="image" bindtap="onsjimage" data-id="1"><image src='{{sjimage1}}'></image><text>营业执照</text></view>
<view class="image" bindtap="onsjimage" data-id="2"><image src='{{sjimage2}}'></image><text>银行卡</text></view>
<view class="image" bindtap="onsjimage" data-id="3"><image src='{{sjimage3}}'></image><text>身份证正面</text></view>
<view class="image" bindtap="onsjimage" data-id="4"><image src='{{sjimage4}}'></image><text>身份证反面</text></view>
</view>
</view>
<view class="area" bindtap="onarea">
<text>所在地区:</text><input name="area" type="text" disabled="disabled" placeholder="请选择地区" value="{{area}}"/><image src="../../images/icon-arrowdown.png"></image>
</view>
<view>
<text>详细地址:</text><input name="detail" type="text" placeholder="请填写街道、楼牌号等" value="{{detail}}" />
</view>
<view class="area" bindtap="onannotatemap">
<text>标注地图:</text><input name="annotatemap" type="text" disabled="disabled" placeholder="请标注地图" value="{{annotatemap}}"/><image src="../../images/icon-arrowdown.png"></image>
</view>
<view>
<text>服务内容:</text><input name="fwbody" type="text" placeholder="请填写服务内容" value="{{fwbody}}" />
</view>
</view>
<view class="frombody" wx:if="{{byNumber==1}}">
<view style="font-weight: 800;color:#ff4d00;">
第二步:填写收款银行资料
</view>
<view>
<text>开户姓名:</text><input name="AccountName" type="text" placeholder="请填写您的开户姓名" value="{{AccountName}}" />
</view>
<view class="area" bindtap="onBank">
<text>银行名称:</text>
<picker class="picker_hx" name="picker_hx" value="{{BankNames[index].key}}" data-selecthx="{{BankNames[index].key}}" range="{{BankNames}}" range-key="{{'key'}}" bindchange="BankChange"> <view class="picker">
<text wx:if='{{BankNames[index]!=null}}'>{{BankNames[index].key}}</text>
<text wx:if='{{BankNames[index]==null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view></picker>
</view>
<view>
<text>银行卡号:</text><input name="BankCard" type="text" placeholder="请填写银行卡号" value="{{BankCard}}" />
</view>
<view>
<text>开户行或联行号:</text><input name="BankDepos" type="text" placeholder="对公请填写联行号" value="{{BankDepos}}" />
</view>
</view>
<view class="frombody" wx:if="{{byNumber==2}}">
<view style="font-weight: 800;color:#ff4d00;">
第三步:请您阅读《{{showtitle}}》。
</view>
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
</view>
</view>
<view class="frombody" wx:if="{{byNumber==3}}">
<view style="font-weight: 800;color:#ff4d00;">
第四步:请您在下面方框(横屏)签字、完成提交。
</view>
<view class="qianming_box">
<canvas class="canvas" id="canvas" type="2d" disable-scroll="true" bindtouchstart="canvasStart" bindtouchmove="canvasMove" bindtouchend="canvasEnd" touchcancel="canvasEnd" binderror="canvasIdErrorCallback"></canvas>
</view>
</view>
<view style="height: 3em;border: 0;">
</view>
</view>
<view class="footer">
<button class="resetbutton" type="default" wx:if="{{byNumber==3}}" bindtap="clickClear">重新签名</button>
<button class="{{byNumber==0||byNumber==1||byNumber==3?'savebutton':''}}" form-type="submit" data-type="0">{{savebutton}}</button>
<button wx:if='{{(byNumber==0||byNumber==1)&&savebutton=="下一步"}}' class="savebutton" form-type="submit" data-type="1">保存草稿</button>
</view>
</form>
</view>
<view class="Hidden_box" hidden="{{sectionHidden}}" bindtap="closesection">
<view class="section" catchtap="insection">
<view class="section-title">省市区选择器</view>
<view class="close" bindtap="closesection"><image src="../../images/close.png" /></view>
<view class="section-body">
<view>
<text>省份:</text>
<picker class="picker_hx" name="picker_hx" value="{{Provinces[hx_index].ProvinceID}}" data-selecthx="{{Provinces[hx_index].ProvinceName}}" range="{{Provinces}}" range-key="{{'ProvinceName'}}" bindchange="ProvinceChange">
<view class="picker">
<text hidden='{{Provinces[hx_index].ProvinceName==null}}'>{{Provinces[hx_index].ProvinceName}}</text>
<text hidden='{{Provinces[hx_index].ProvinceName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>城市:</text>
<picker class="picker_hx" name="picker_hx" value="{{Citys[hx_index0].CityID}}" data-selecthx="{{Citys[hx_index0].CityName}}" range="{{Citys}}" range-key="{{'CityName'}}" bindchange="CityChange">
<view class="picker">
<text hidden='{{Citys[hx_index0].CityName==null}}'>{{Citys[hx_index0].CityName}}</text>
<text hidden='{{Citys[hx_index0].CityName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>县区:</text>
<picker class="picker_hx" name="picker_hx" value="{{Countys[hx_index1].CountyID}}" data-selecthx="{{Countys[hx_index1].CountyName}}" range="{{Countys}}" range-key="{{'CountyName'}}" bindchange="CountyChange">
<view class="picker">
<text hidden='{{Countys[hx_index1].CountyName==null}}'>{{Countys[hx_index1].CountyName}}</text>
<text hidden='{{Countys[hx_index1].CountyName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{sectionHidden0}}" bindtap="closesection0">
<view class="section" catchtap="insection" style="margin-top: 0em; width: 100%; height: 100%;padding: 0;">
<view class="section-title">点击地图标注</view>
<view class="close" bindtap="closesection0"><image src="../../images/close.png" /></view>
<view class="section-body">
<map id="myMap" latitude="{{latitude}}" longitude="{{longitude}}" scale="{{scale}}" style="width: 100%; height: 86vh;" show-location="{{true}}" bindtap="maptap" bindpoitap="maptap" bindmarkertap="markertap" bindregionchange="regionchange" markers="{{markers}}">
<cover-view class="loading" wx:if="{{loading}}">
<cover-view class="loading-to">
<cover-image src="../../images/ajaxLoader.gif"></cover-image>
</cover-view>
</cover-view>
</map>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,124 @@
page{
background: #ccc;
}
.container {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.footer{
position: fixed;
z-index: 10000;
bottom:0;
left:0;
width: 100%;
text-align: center;
padding: 0;
}
.footer{
display: flex;
flex-direction: row;
}
.footer button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff;border-radius:0;}
.footer button.resetbutton{width:50%;background:linear-gradient(to right,#2CC105,#2CC105); color:#fff;}
.footer button.savebutton{width:50%;}
.myaddress-box{display: flex;flex-direction: column;flex-grow: 1; align-items: center;justify-content: center;width:100%; padding:0; box-sizing: border-box;}
.myaddress-item{width:100%; padding:0.8em; box-sizing: border-box;border:1px solid #f1f1f1; background-color:#fff;border-radius:0.5em;}
.myaddress-contact{width:100%;}
.myaddress-bottom{width:100%;margin-top:0.5em; display: flex;flex-direction: row; align-items: center;justify-content: center;}
.myaddress-bottom .myaddress-btn{width:100%;}
.myaddress-bottom .myaddress-btn image{width:1.2em;height:1.2em; vertical-align: middle;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.myaddress-box .frombody{padding:0.8em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.myaddress-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.myaddress-box .frombody view.wxParse{
max-width: 100%;
display: block;
}
.myaddress-box .frombody view.wxParse view{
border-bottom:0;
padding:0;
display: block;
}
.myaddress-box .frombody view.wxParse img,.myaddress-box .frombody view.wxParse image{
max-width: 100%;
}
.myaddress-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view.area input{width:12.8em;}
.myaddress-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.myaddress-box .frombody view view.picker{
margin-top: -0.4em;
width:14em;
border-bottom:0;
height:2.5em; line-height: 2.5em;
}
.myaddress-box .frombody view.upimage_box text{width: 12.8em;}
.myaddress-box .frombody view.upimage_box .image{border: 0;}
.myaddress-box .frombody view.upimage_box .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.myaddress-box .frombody view.upimage0_box{flex-direction: column;}
.myaddress-box .frombody view.upimage0_box view{border: 0;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to{flex-direction:row}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image{flex-direction:column}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image text{font-size: 0.85em;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.section{position: relative; bottom:0; width:90%; height:20em; padding: 0 1em; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.section .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.section .close image{width:100%;height:100%;}
.section-title{width:100%;height:2.5em; line-height: 2.5em; text-align: center; font-weight: 600;border-bottom:1px solid #f1f1f1;}
.section-body{width:100%;}
.section-body view{width:100%;display: flex;flex-direction: row; align-items: center;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height:1.5em;}
.section-body view text{color:#000;}
.section-body view .picker_hx{color:#939393;line-height:2.5em;}
.section-body view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:10em; padding-left:1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;line-height:2em;}
.section-body view .picker_hx image{position: absolute; top:1em;right:0.6em; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.area .picker_hx{display: flex;flex-direction:row;}
.myaddress-box .frombody view.area .picker_hx input{position: absolute; top:0.6em;right:1.6em;}
.myaddress-box .frombody view.qianming_box{
width: 100%;
height: 84vh;
background-color: #f1f1f1;
}
.myaddress-box .frombody view.qianming_box .canvas {
width: 100%;
height: 100%;
flex: 1;
box-sizing: border-box;
background-color: #eee;
}
.loading{
position: fixed;
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-items: center;
background-color: rgba(0, 0, 0, 0);
z-index: 10005;
}
.loading-to{
margin: 0 auto;
width: 3em;
height: 3em;
}
.loading-to image{
width: 100%;
height: 100%;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

659
pages/appbusiness0/index.js Normal file
View File

@@ -0,0 +1,659 @@
var app = getApp()
var that=null
var sopenFrame=null
var areas = null;
Page( {
data: {
loadingHidden:false,
loading:false,
sjname:"",
number:"",
tel:"",
sjimage0:"../../images/add.png",
sjimage1:"../../images/add.png",
sjimage2:"../../images/add.png",
sjimage3:"../../images/add.png",
sjimage4:"../../images/add.png",
sjimage5:"../../images/add.png",
sjimage6:"../../images/add.png",
addimage0:"",
addimage1:"",
addimage2:"",
addimage3:"",
addimage4:"",
addimage5:"",
addimage6:"",
annotatemap:"",
detail:"",
fwbody:"",
sectionHidden:true,
sectionHidden0:true,
IFDefault:1,
savebutton:"提交",
Provinces:[],
Citylist:[],
Citys:[],
Countys:[],
hx_index:-1,
hx_index0:-1,
hx_index1:-1,
area:"",
addressId:0,
clslist:[],
hc_index:-1,
clsid:0,
clsname:"",
latitude:0,
longitude:0,
scale:15,
markers: [],
bzlatitude:0,
bzlongitude:0,
uid:0,
},
onReady: function(e) {
// 使用 wx.createMapContext 获取 map 上下文
this.mapCtx = wx.createMapContext('myMap');
},
onLoad: function() {
that = this
areas = require('../../area.js');
that.setData({
Provinces:areas.areaslist,
Citylist:areas.Citylist
})
that.rdata()
},rdata: function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId){
var userInfo = JSON.parse(userInfodata)
that.setData({
uid:userInfo.id
})
}
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getbusinessinfo0",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"GET",
dataType:"json",
success (res) {
if(res.data.status==1){
that.setData({
clslist:res.data.clslist,
loadingHidden:true
})
}
}
})
},clsChange:function(e) {
var index=e.detail.value;
that.setData({
hc_index: index,
clsid:that.data.clslist[index].id,
clsname:that.data.clslist[index].name,
sectionHidden0:true
})
},onarea:function(e) {
that.setData({
sectionHidden:false
})
},ProvinceChange:function(e) {
var index=e.detail.value;
var citys=that.data.Provinces[index].City
that.setData({
hx_index: index,
hx_index0: -1,
hx_index1: -1,
Citys:citys
})
if(citys.length==0){
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName
})
}
},CityChange:function(e) {
var index=e.detail.value
var countys=that.data.Citys[index].County
that.setData({
hx_index0: index,
hx_index1: -1,
Countys:countys
})
if(countys.length==0){
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName+that.data.Citys[that.data.hx_index0].CityName
})
}
},CountyChange:function(e) {
that.setData({
hx_index1: e.detail.value
})
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName+that.data.Citys[that.data.hx_index0].CityName+that.data.Countys[that.data.hx_index1].CountyName
})
},onannotatemap:function(e) {
if(that.data.hx_index==-1||that.data.hx_index0==-1){
wx.showToast({
title: "请选选择地区!",
icon: "none",
duration: 3000
})
}else{
//获取经纬度
wx.getLocation({
type: 'gcj02',
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
that.setData({
latitude: latitude,
longitude: longitude,
})
},fail: function (res) {
wx.showToast({
title: "获取定位失败!",
icon: "none",
duration: 3000
})
}
})
/* var center="";
if(that.data.hx_index>-1&&that.data.hx_index0>-1){
center=that.data.Citys[that.data.hx_index0].center
if(that.data.hx_index1>-1){
center=that.data.Countys[that.data.hx_index1].center
}
if(center!=""){
var acenter=center.split(",");
that.setData({
latitude: acenter[1],
longitude: acenter[0],
})
}
}*/
that.setData({
sectionHidden0:false,
loading:true,
savebutton:"标注好了,返回"
})
var sopenFrame0=setInterval(function (){
clearInterval(sopenFrame0);
that.setData({
loading:false
})
},1000)
}
},maptap:function(e) {
that.setData({
loading:true,
bzlatitude: e.detail.latitude,
bzlongitude: e.detail.longitude,
markers: [{
id:8900,
latitude: e.detail.latitude,
longitude: e.detail.longitude,
iconPath: '../../images/position-picker2.png',
width: 80,
height: 80,
enableDragging: true
}],
annotatemap:"已标注",
})
var sopenFrame0=setInterval(function (){
clearInterval(sopenFrame0);
that.setData({
loading:false
})
},500)
},
regionchange(e) {
console.log(e)
},markertap:function(e) {
},closesection:function(e) {
that.setData({
sectionHidden:true,
})
},closesection0:function(e) {
that.setData({
sectionHidden0:true,
savebutton:"提交"
})
},insection:function(e) {
},onsjimage:function(e) {
var id = e.currentTarget.dataset.id
var yimage=that.data.sjimage0
if(id==1){
yimage=that.data.sjimage1
}else if(id==2){
yimage=that.data.sjimage2
}else if(id==3){
yimage=that.data.sjimage3
}else if(id==4){
yimage=that.data.sjimage4
}else if(id==5){
yimage=that.data.sjimage5
}else if(id==6){
yimage=that.data.sjimage6
}
if(yimage=="../../images/ajaxLoader.gif"){
wx.showToast({
title: "正在上传中...",
icon: "none",
duration: 3000
})
}else{
wx.chooseImage({
count: 1,
sizeType: ['original'],
sourceType: ['album', 'camera'],
success (res) {
const tempFilePaths = res.tempFilePaths;
if(id==0){
that.setData({
sjimage0:"../../images/ajaxLoader.gif"
})
}else if(id==1){
that.setData({
sjimage1:"../../images/ajaxLoader.gif"
})
}else if(id==2){
that.setData({
sjimage2:"../../images/ajaxLoader.gif"
})
}else if(id==3){
that.setData({
sjimage3:"../../images/ajaxLoader.gif"
})
}else if(id==4){
that.setData({
sjimage4:"../../images/ajaxLoader.gif"
})
}else if(id==5){
that.setData({
sjimage5:"../../images/ajaxLoader.gif"
})
}else if(id==6){
that.setData({
sjimage6:"../../images/ajaxLoader.gif"
})
}
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.uploadFile({
url: app.globalData.apiurl + "/xapiajax.ashx", //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image',
formData: {
action:"uploadImage",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
fail: function(err) {
wx.showToast({
title: "上传出错了",
icon: "none",
duration: 2000
})
if(id==0){
that.setData({
sjimage0:yimage
})
}else if(id==1){
that.setData({
sjimage1:yimage
})
}else if(id==2){
that.setData({
sjimage2:yimage
})
}else if(id==3){
that.setData({
sjimage3:yimage
})
}else if(id==4){
that.setData({
sjimage4:yimage
})
}else if(id==5){
that.setData({
sjimage5:yimage
})
}else if(id==6){
that.setData({
sjimage6:yimage
})
}
},
success (res0){
var data=JSON.parse(res0.data);
if(data.status==1){
wx.showToast({
title: data.msg,
icon: "success",
duration: 1000
})
if(id==0){
that.setData({
sjimage0:data.url,
addimage0:data.pic
})
}else if(id==1){
that.setData({
sjimage1:data.url,
addimage1:data.pic
})
}else if(id==2){
that.setData({
sjimage2:data.url,
addimage2:data.pic
})
}else if(id==3){
that.setData({
sjimage3:data.url,
addimage3:data.pic
})
}else if(id==4){
that.setData({
sjimage4:data.url,
addimage4:data.pic
})
}else if(id==5){
that.setData({
sjimage5:data.url,
addimage5:data.pic
})
}else if(id==6){
that.setData({
sjimage6:data.url,
addimage6:data.pic
})
}
}else{
wx.showToast({
title: data.msg,
icon: "none",
duration: 2000
})
if(id==0){
that.setData({
sjimage0:yimage
})
}else if(id==1){
that.setData({
sjimage1:yimage
})
}else if(id==2){
that.setData({
sjimage2:yimage
})
}else if(id==3){
that.setData({
sjimage3:yimage
})
}else if(id==4){
that.setData({
sjimage4:yimage
})
}else if(id==5){
that.setData({
sjimage5:yimage
})
}else if(id==6){
that.setData({
sjimage6:yimage
})
}
}
}
});
}
})
}
},saveaddress:function(e) {
if(that.data.savebutton=="标注好了,返回")
{
that.setData({
sectionHidden0:true,
savebutton:"提交"
})
}else{
var name = e.detail.value.txtName.replace(/\s+/g, "");
var number=e.detail.value.txtnumber.replace(/\s+/g, "");
var tel=e.detail.value.txttel.replace(/\s+/g, "");
var Province=(that.data.hx_index==-1?"":that.data.Provinces[that.data.hx_index].ProvinceID)
var City=(that.data.hx_index0==-1?"":that.data.Citys[that.data.hx_index0].CityID)
var County=(that.data.hx_index1==-1?"":that.data.Countys[that.data.hx_index1].CountyID)
var detail=e.detail.value.detail.replace(/\s+/g, "");
var fwbody=e.detail.value.fwbody
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var b=true
if(that.data.clsid==0){
b=false
wx.showToast({
title: "商家分类未选择!",
icon: "none",
duration: 3000
})
}
if(b){
if(name==""){
b=false
wx.showToast({
title: "商家名称不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(number==""){
b=false
wx.showToast({
title: "信用代码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(tel==""){
b=false
wx.showToast({
title: "联系电话不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.addimage0==""){
b=false
wx.showToast({
title: "预览图片未上传!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.addimage1==""){
b=false
wx.showToast({
title: "营业执照未上传!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.addimage2==""){
b=false
wx.showToast({
title: "门头照片未上传!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.addimage3==""){
b=false
wx.showToast({
title: "身份证正面未上传!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.addimage4==""){
b=false
wx.showToast({
title: "身份证反面未上传!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.hx_index==-1){
b=false
wx.showToast({
title: "省份必须选择!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.hx_index0==-1){
b=false
wx.showToast({
title: "城市必须选择!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(detail==null || detail==""){
b=false
wx.showToast({
title: "详细地址不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.bzlatitude==0||that.data.bzlongitude==0){
b=false
wx.showToast({
title: "未标注地图!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.savebutton!='提交'){
b=false
}
}
if(b){
that.setData({
savebutton:"请稍候..."
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"updatebusinessinfo0",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
clsid:that.data.clsid,
name:name,
number:number,
tel:tel,
image0:that.data.addimage0,
image1:that.data.addimage1,
image2:that.data.addimage2,
image3:that.data.addimage3,
image4:that.data.addimage4,
image5:that.data.addimage5,
image6:that.data.addimage6,
province:Province,
city:City,
county:County,
address:detail,
longitude:that.data.bzlongitude,
latitude:that.data.bzlatitude,
fwbody:fwbody
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
app.globalData.IFRefreshmy=1
var sopenFrame0=setInterval(function (){
clearInterval(sopenFrame0);
wx.showModal({
title: "申请提示",
content:"您的申请已经提交成功了,请等待审核!",
showCancel:false,
success (res0) {
if (res0.confirm) {
that.setData({
savebutton:"提交"
})
wx.navigateBack({})
}
}
})
}, 2000);
}else{
that.setData({
savebutton:"保存"
})
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
}
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "申请线上供应链"
}

View File

@@ -0,0 +1,122 @@
<view class="container">
<form bindsubmit='saveaddress' wx:if="{{uid>68}}">
<view class="myaddress-box">
<view class="frombody">
<view class="area">
<picker class="picker_hx" name="picker_hx0" value="{{clslist[hc_index].id}}" data-selecthx="{{clslist[hc_index].name}}" range="{{clslist}}" range-key="{{'name'}}" bindchange="clsChange">
<text>商家分类:</text><input name="sjfl" type="text" disabled="disabled" placeholder="请选择商家分类" value="{{clsname}}"/><image src="../../images/icon-arrowdown.png"></image>
</picker>
</view>
<view>
<text>商家名称:</text><input name="txtName" type="text" placeholder="请填写商家名称" value="{{sjname}}" />
</view>
<view>
<text>信用代码:</text><input name="txtnumber" type="text" placeholder="请填写统一社会信用代码" value="{{number}}" />
</view>
<view>
<text>联系电话:</text><input name="txttel" type="text" placeholder="请填写联系电话" value="{{tel}}" />
</view>
<view class="upimage_box" style="border-bottom: 0;">
<text>上传预览图片:</text><view class="image"><image src='{{sjimage0}}' bindtap="onsjimage" data-id="0"></image></view>
</view>
<view class="upimage0_box">
<view class="upimage0_title">上传证件:</view>
<view class="upimage0_box_to">
<view class="image" bindtap="onsjimage" data-id="1"><image src='{{sjimage1}}'></image><text>营业执照</text></view>
<view class="image" bindtap="onsjimage" data-id="2"><image src='{{sjimage2}}'></image><text>门头照片</text></view>
<view class="image" bindtap="onsjimage" data-id="3"><image src='{{sjimage3}}'></image><text>身份证正面</text></view>
<view class="image" bindtap="onsjimage" data-id="4"><image src='{{sjimage4}}'></image><text>身份证反面</text></view>
</view>
</view>
<view class="area" bindtap="onarea">
<text>所在地区:</text><input name="area" type="text" disabled="disabled" placeholder="请选择地区" value="{{area}}"/><image src="../../images/icon-arrowdown.png"></image>
</view>
<view>
<text>详细地址:</text><input name="detail" type="text" placeholder="请填写街道、楼牌号等" value="{{detail}}" />
</view>
<view class="area" bindtap="onannotatemap">
<text>标注地图:</text><input name="annotatemap" type="text" disabled="disabled" placeholder="请标注地图" value="{{annotatemap}}"/><image src="../../images/icon-arrowdown.png"></image>
</view>
<view>
<text>服务内容:</text><input name="fwbody" type="text" placeholder="请填写服务内容" value="{{fwbody}}" />
</view>
<view style="height: 3em;">
</view>
</view>
</view>
<view class="footer">
<button form-type="submit">{{savebutton}}</button>
</view>
</form>
</view>
<view class="Hidden_box" hidden="{{sectionHidden}}" bindtap="closesection">
<view class="section" catchtap="insection">
<view class="section-title">省市区选择器</view>
<view class="close" bindtap="closesection"><image src="../../images/close.png" /></view>
<view class="section-body">
<view>
<text>省份:</text>
<picker class="picker_hx" name="picker_hx" value="{{Provinces[hx_index].ProvinceID}}" data-selecthx="{{Provinces[hx_index].ProvinceName}}" range="{{Provinces}}" range-key="{{'ProvinceName'}}" bindchange="ProvinceChange">
<view class="picker">
<text hidden='{{Provinces[hx_index].ProvinceName==null}}'>{{Provinces[hx_index].ProvinceName}}</text>
<text hidden='{{Provinces[hx_index].ProvinceName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>城市:</text>
<picker class="picker_hx" name="picker_hx" value="{{Citys[hx_index0].CityID}}" data-selecthx="{{Citys[hx_index0].CityName}}" range="{{Citys}}" range-key="{{'CityName'}}" bindchange="CityChange">
<view class="picker">
<text hidden='{{Citys[hx_index0].CityName==null}}'>{{Citys[hx_index0].CityName}}</text>
<text hidden='{{Citys[hx_index0].CityName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>县区:</text>
<picker class="picker_hx" name="picker_hx" value="{{Countys[hx_index1].CountyID}}" data-selecthx="{{Countys[hx_index1].CountyName}}" range="{{Countys}}" range-key="{{'CountyName'}}" bindchange="CountyChange">
<view class="picker">
<text hidden='{{Countys[hx_index1].CountyName==null}}'>{{Countys[hx_index1].CountyName}}</text>
<text hidden='{{Countys[hx_index1].CountyName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{sectionHidden0}}" bindtap="closesection0">
<view class="section" catchtap="insection" style="margin-top: 0em; width: 100%; height: 100%;padding: 0;">
<view class="section-title">点击地图标注</view>
<view class="close" bindtap="closesection0"><image src="../../images/close.png" /></view>
<view class="section-body">
<map id="myMap" latitude="{{latitude}}" longitude="{{longitude}}" scale="{{scale}}" style="width: 100%; height: 86vh;" show-location="{{true}}" bindtap='maptap' bindmarkertap="markertap" bindregionchange="regionchange" markers="{{markers}}">
<cover-view class="loading" wx:if="{{loading}}">
<cover-view class="loading-to">
<cover-image src="../../images/ajaxLoader.gif"></cover-image>
</cover-view>
</cover-view>
</map>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,87 @@
page{
background: #ccc;
}
.container {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.footer{
position: fixed;
z-index: 10000;
bottom:0;
left:0;
width: 100%;
text-align: center;
padding: 0;
}
.footer button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff;border-radius:0;}
.myaddress-box{display: flex;flex-direction: column;flex-grow: 1; align-items: center;justify-content: center;width:100%; padding:0; box-sizing: border-box;}
.myaddress-item{width:100%; padding:0.8em; box-sizing: border-box;border:1px solid #f1f1f1; background-color:#fff;border-radius:0.5em;}
.myaddress-contact{width:100%;}
.myaddress-bottom{width:100%;margin-top:0.5em; display: flex;flex-direction: row; align-items: center;justify-content: center;}
.myaddress-bottom .myaddress-btn{width:100%;}
.myaddress-bottom .myaddress-btn image{width:1.2em;height:1.2em; vertical-align: middle;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.myaddress-box .frombody{padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.myaddress-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.myaddress-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view.area input{width:12.8em;}
.myaddress-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.upimage_box text{width: 12.8em;}
.myaddress-box .frombody view.upimage_box .image{border: 0;}
.myaddress-box .frombody view.upimage_box .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.myaddress-box .frombody view.upimage0_box{flex-direction: column;}
.myaddress-box .frombody view.upimage0_box view{border: 0;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to{flex-direction:row}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image{flex-direction:column}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image text{font-size: 0.85em;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.section{position: relative; bottom:0; width:90%; height:20em; padding: 0 1em; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.section .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.section .close image{width:100%;height:100%;}
.section-title{width:100%;height:2.5em; line-height: 2.5em; text-align: center; font-weight: 600;border-bottom:1px solid #f1f1f1;}
.section-body{width:100%;}
.section-body view{width:100%;display: flex;flex-direction: row; align-items: center;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height:1.5em;}
.section-body view text{color:#000;}
.section-body view .picker_hx{color:#939393;line-height:2.5em;}
.section-body view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:10em; padding-left:1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;line-height:2em;}
.section-body view .picker_hx image{position: absolute; top:1em;right:0.6em; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.area .picker_hx{display: flex;flex-direction:row;}
.myaddress-box .frombody view.area .picker_hx input{position: absolute; top:0.6em;right:1.6em;}
.loading{
position: fixed;
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-items: center;
background-color: rgba(0, 0, 0, 0);
z-index: 10005;
}
.loading-to{
margin: 0 auto;
width: 3em;
height: 3em;
}
.loading-to image{
width: 100%;
height: 100%;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

View File

@@ -0,0 +1,73 @@
var WxParse = null;
var app = getApp()
var that=null
var aid=0
Page( {
data: {
loadingHidden:false,
type:0,
ltype:0,
body:""
},
onLoad: function(options) {
that = this
WxParse = require('../../wxParse/wxParse.js')
aid=options.id
that.rdata();//第一次加载数据
}, rdata: function () {
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getnewdetail",
id:aid
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
WxParse.wxParse('body', 'html', res.data.content, that);
if(res.data.type==6||res.data.type==7){
wx.setNavigationBarTitle({
title: res.data.title
})
}else if(res.data.type==8){
wx.setNavigationBarTitle({
title: "健康知识"
})
}else if(res.data.type==9){
wx.setNavigationBarTitle({
title: "发图素材"
})
}else if(res.data.type==19){
wx.setNavigationBarTitle({
title: "操作教程"
})
}else{
wx.setNavigationBarTitle({
title: "公告详情"
})
}
that.setData({
loadingHidden:true,
type: res.data.type,
ltype: res.data.ltype,
title: res.data.title
})
}
})
},
// 下拉刷新
onPullDownRefresh: function () {
that.rdata();//第一次加载数据
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": ""
}

View File

@@ -0,0 +1,11 @@
<import src="../../wxParse/wxParse.wxml"/>
<view class="shopping_container">
<view class="title" wx:if="{{type!=6&&type!=7}}">{{title}}</view>
<view class="wxParse {{ltype==1?'shuping':''}}">
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,57 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.shopping_container{
position: relative;
padding: 20rpx;
width:100%;
background-color:#fff;
box-sizing: border-box;
overflow: hidden;
}
.shopping_container .title{
margin: 20rpx 0;
width:100%;
text-align: center;
font-weight: bold;
color: #333;
}
.shopping_container .wxParse{
position: relative;
float: left;
padding: 0;
width:100%;
text-align: center;
box-sizing: border-box;
overflow: hidden;
}
.shopping_container .wxParse view{
text-indent: 2em;
}
.shopping_container .wxParse image{
position: relative;
float: left;
width:100%;
}
.shopping_container .wxParse img{
width:100%;
}
.shopping_container .wxParse video{
float: left;
width:100%;
height:18em;
background-color: #000;
}
.shopping_container .wxParse.shuping video{
height:35em;
}

144
pages/articles/index.js Normal file
View File

@@ -0,0 +1,144 @@
var WxParse = null;
var app = getApp()
var that=null
var that0=null
var t=0
Page( {
data: {
loadingHidden:false,
nodataHidden:true,
bodyHidden:true,
Start: 0,
articles:[]
},
onLoad: function(options) {
that = this
t=options.t
if(t==0){
wx.setNavigationBarTitle({
title: "发图素材"
})
}else if(t==1){
wx.setNavigationBarTitle({
title: "健康知识"
})
}
that.getlist(0);//第一次加载数据
},
// 下拉刷新
onPullDownRefresh: function () {
that.clearCache();
that.getlist(0);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.getlist(1);//后台获取新数据并追加渲染
}, getlist: function (gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:(t==1?"getjkzslist":"getftsclist"),
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
Start:that.data.Start
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
var tmpArr = null;
tmpArr = that.data.articles;
tmpArr.push.apply(tmpArr,res.data.data);
that.setData({
articles: tmpArr,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
if(gp==0||gp==1){
if(res.data.data.length==0){
that.setData({
nodataHidden:false
})
}else{
that.setData({
nodataHidden:true
})
}
}
}
})
},
// 清缓存
clearCache:function(){
that.setData({
articles: [],
Start: 0,
loadingHidden:false
});
},ondetail:function(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../articledetail/index?id="+id
})
/*that.setData({
loadingHidden:false
})
var id = e.currentTarget.dataset.id
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getnewdetail",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
id:id
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
WxParse.wxParse('body', 'html', res.data.content, that);
that.setData({
title:res.data.title,
video:res.data.video,
bodyHidden:false
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
that.setData({
loadingHidden:true
})
}
})*/
},closeserver:function(e) {
that.data.videoCtx.stop()
that.setData({
bodyHidden:true
})
},inserver :function(e) {
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": ""
}

38
pages/articles/index.wxml Normal file
View File

@@ -0,0 +1,38 @@
<import src="../../wxParse/wxParse.wxml"/>
<view class="container">
<view class="news-box" >
<view class="news-item" wx:for="{{articles}}" wx:for-item="cell">
<view class="news-item-to" bindtap="ondetail" data-id="{{cell.id}}">
<view class="pic"><image src="{{cell.pic}}"></image></view>
<view class="title_time">
<view class="title">{{cell.title}}</view>
<view class="time">{{cell.createTime}}</view>
</view>
</view>
</view>
</view>
<view class="nodata" hidden="{{nodataHidden}}">
<image src="../../images/order-null.png"/>
<view>暂无数据</view>
</view>
</view>
<view class="Hidden_box" hidden="{{bodyHidden}}" bindtap="closeserver">
<view class="Hidden_box_to" catchtap="inserver">
<view class="close" bindtap="closeserver"><image src="../../images/close.png" /></view>
<view class="title">视频详情</view>
<view class="body">
<view class="title">{{title}}</view>
<video id="myVideo" wx:if='{{video!=""}}' src="{{video}}" autoplay enable-danmu danmu-btn controls></video>
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

57
pages/articles/index.wxss Normal file
View File

@@ -0,0 +1,57 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.text{
margin-top: 0;
line-height: 2.5em;
display: flex;
flex-direction: row;
align-items: center;
background-color: #fff;
border-bottom:1px solid #f1f1f1;
}
.text .line_flag{
margin-top: 0em;
margin-left: 5px;
margin-right: 0.5em;
width:0.5em;
height: 1.5em;
line-height: 1.5em;
background-color: #f0514d;
border-radius:0.2em;
}
.news-box{width:100%; padding:0;padding-top: 0.4em;padding-left:0.8em;box-sizing: border-box;}
.news-item{position: relative; float:left; width:100%; margin:0; padding:0.8em; padding-top: 0; padding-left:0; box-sizing: border-box; text-align: left;}
.news-item-to{ display: flex; flex-direction: row; position: relative; float:none; width:100%; margin:0; padding:0.8em; box-sizing: border-box; text-align: left; background-color: #fff; border-radius:0.5em;overflow: hidden;}
.news-item .title_time{display: flex; flex-direction:column;flex-grow: 1; background-color:#fff; line-height:1.2em;padding-left:0.8em; box-sizing: border-box;
overflow: hidden;}
.news-item .title_time .title{height:4em;}
.news-item .title_time .time{color:#848484; font-size: 0.85em;}
.news-item .pic{width: 10em;padding: 0; box-sizing: border-box;}
.news-item .pic image{width:100%;height:5em; border-radius:0.5em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);}
.Hidden_box_to{position: relative; padding: 8px; width:95%;height:auto; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.Hidden_box_to.addcart_box{ position: absolute; bottom:0; width:100%;border-radius:0.5em 0.5em 0 0;}
.Hidden_box_to .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.Hidden_box_to .close image{width:100%;height:100%;}
.Hidden_box_to .title{ width:100%;height:2.5em;line-height: 2.5em; font-weight: 800; border-bottom:1px solid #f1f1f1;}
.Hidden_box_to .body{line-height:1.5em; color:#939393;max-height:80vh; overflow-y: auto;}
.Hidden_box_to .body .title{ width:100%;height:2.5em; line-height: 2.5em; text-align: center;}
.Hidden_box_to .body img{max-width:100%;}
.Hidden_box_to .body video{width:100%;height:15em;}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

274
pages/business/index.js Normal file
View File

@@ -0,0 +1,274 @@
var WxParse = null;
var app = getApp()
var that=null
var that0=null
Page( {
data: {
loadingHidden:false,
nodataHidden:true,
indicatorDots: true,
indicatorDots0: true,
vertical: false,
vertical0: false,
autoplay: true,
interval: 6000,
interval0: 8000,
duration: 1000,
duration0: 1000,
business:[],
navData:[],
nav:0,
Start: 0,
qkeyword:"请输入关键字",
keyword:"",
},onShow: function () {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
that0=this;
var userId = wx.getStorageSync("userId")
var userInfodata = wx.getStorageSync("userInfo")
var sel=2;
var ifsel=0;
if(userId&&userInfodata){
var userInfo = JSON.parse(userInfodata)
ifsel=userInfo.bdshEnable;
}
if(ifsel==1){
that0.getTabBar().setData({
"list": [
{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
}else{
that0.getTabBar().setData({
"list": [
{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/business/index",
"iconPath": "/images/footer-icon-02.png",
"selectedIconPath": "/images/footer-icon-02-active.png",
"text": "门店"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
}
that0.getTabBar().setData({
selected: sel
})
}
},
onLoad: function(options) {
that = this
wx.setBackgroundColor({
backgroundColor: "#00B050",
})
that.clearCache();//清本页缓存
that.getlist(0);//第一次加载数据
var sopenFrame0=setInterval(function (){
clearInterval(sopenFrame0);
wx.getLocation({
type: 'gcj02', // 比较精确
success: (res) => {
wx.setStorageSync("latitude", res.latitude)
wx.setStorageSync("longitude", res.longitude)
that.clearCache();//清本页缓存
that.getlist(0);
},fail: (err) => {
/*wx.showToast({
title: JSON.stringify(err),
icon: "none",
duration: 20000
})*/
}
})
},1000);
},
// 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
Start: 0,
loadingHidden:false
});
}, getlist: function (gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var latitude = wx.getStorageSync("latitude")
var longitude = wx.getStorageSync("longitude")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getBusinessdata",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
keyword:that.data.keyword,
t:(that.data.nav>0?that.data.nav:""),
Start:that.data.Start,
latitude:(!latitude?"":latitude),
longitude:(!longitude?"":longitude),
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
if(gp==0||gp==1){
tmpArr = res.data.Businesslist
}else{
tmpArr = that.data.business;
tmpArr.push.apply(tmpArr,res.data.Businesslist);
}
that.setData({
business: tmpArr,
Start: that.data.Start+res.data.Businesslist.length,
loadingHidden:true
})
if(gp==0||gp==1){
that.setData({
navData:res.data.lbs
})
if(res.data.Businesslist.length==0){
that.setData({
nodataHidden:false
})
}else{
that.setData({
nodataHidden:true
})
}
}
}
else{
if(res.data.msg=="您未登录"){
wx.removeStorageSync('userId')
wx.removeStorageSync('LoginId')
}
}
if(gp==0||gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},onsearch:function() {
var keyword=that.data.keyword.replace(/\s+/g, "");
if(keyword!=""){
that.setData({
keyword:keyword
})
that.clearCache();//清本页缓存
that.getlist(0);//第一次加载数据
}else{
wx.showToast({
title: "关键字不能为空",
icon: "none",
duration: 3000
})
}
},swiperchange0:function(e) {
},closeserver:function(e) {
that.setData({
bodyHidden:true
})
},inserver :function(e) {
},onnav:function(e) {
var index = e.currentTarget.dataset.id
that.setData({
nav:index
})
that.clearCache();
that.getlist(0);
},onamap:function(e) {
var address = e.currentTarget.dataset.id
var lat = e.currentTarget.dataset.lat
var lon = e.currentTarget.dataset.lon
wx.navigateTo({
url: "../map/index?lat=" + lon + "&lon=" + lat + "&address=" + address
})
},oncopy0:function(e) {
var address = e.currentTarget.dataset.id
wx.setClipboardData({
data: address,
success: function (res) {
wx.showToast({
title: "复制成功"
})
}
})
},onview:function(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../businessview/index?id=" + id
})
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "门店"
}

72
pages/business/index.wxml Normal file
View File

@@ -0,0 +1,72 @@
<view class="container">
<view class="container-header">
<view class="header">
<!--<view class="searchbox2">
<view class="logobox"><image src="../../images/logo2.png" /></view>
</view>-->
<view class="searchbox">
<view class="icobox" bindtap="onsearch"><image src="../../images/searchto1.png" /></view>
<view class="inpubox">
<input type="text" placeholder="{{qkeyword}}" confirm-type="search" focus="{{getfocus}}" bindinput="getkeyword" bindconfirm="onsearch" placeholder-style="color:#bbb;" />
</view>
<view class="searchicobox" bindtap="onsearch">搜索</view>
</view>
</view>
</view>
<view class="menudata_box">
<view>
</view>
</view>
<view class="business_box">
<view class="business_item" wx:for="{{business}}" bindtap="onview" data-id="{{item._id}}">
<view class="business_item_top">
<view class="ub item_image">
<image wx:if="{{item.showpic==0}}" src="{{item.image}}" />
</view>
<view class="ub-f1 item_info">
<view class="item_title">{{item.name}}</view>
<view class="item_distance">
<view class="item_distance_box">
<view class="ub-f1">距您直线距离{{item.distance}}</view>
<view class="addressico" catchtap="inserver">
<image src="../../images/Pin-Assistor.png" bindtap="onamap" data-id='{{item.name+"-"+item.address}}' data-lat="{{item.lat}}" data-lon="{{item.lon}}" />
</view>
</view>
</view>
<view class="item_address">
<view class="ub-f1">地址:{{item.address}}</view>
<view class="ub ico" catchtap="inserver">
<view class="ico_box" bindtap="oncopy0" data-id="{{item.address}}">
<image src="../../images/copy.png" />
</view>
</view>
</view>
</view>
</view>
<view class="ub business_item_bottom">
<view class="item_product" wx:for="{{item.products}}" wx:for-item="cell" wx:for-index="index0" catchtap="inserver">
<view bindtap="ondetail" data-id="{{cell._id}}">
<view class="product_image">
<image src="{{cell.image}}" />
</view>
<view class="products_title">{{cell.name}}</view>
<view class="products_price">
<text>¥{{cell.hyje}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="nodata" hidden="{{nodataHidden}}">
<image src="../../images/order-null.png"/>
<view>暂无数据</view>
</view>
</view>

235
pages/business/index.wxss Normal file
View File

@@ -0,0 +1,235 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
padding: 0;
background: #ccc;
box-sizing: border-box;
}
.container-header{ background-color: #00B050;}
.header{margin:0;width:100%; padding:0; padding-top: 0em; box-sizing: border-box;}
.searchbox2{ display: flex; z-index: 100; flex-direction: row; margin:0; margin-top:0.3em; width:70%; height:2.8em; padding:0; box-sizing: border-box;}
.searchbox2 .logobox{margin-left:0.7em;margin-right:0.35em;margin-top:0; width: 6em;height:1.6em; box-sizing:border-box;}
.searchbox2 .logobox image{width: 100%; height:100%;}
.searchbox2 .inpubox{flex-grow: 1;padding-left: 0.8em; height:2.2em; box-sizing:border-box;border-radius:0.5em;}
.searchbox2 .inpubox input{ margin:0; padding-left: 0.2em; width: 100%; font-size:1em; height:2.2em; outline: none; text-indent:0;box-sizing:border-box;color:#000; border:1px solid #f1f1f1;border-radius:0.5em; background-color:#f5f5f5;}
.searchbox2 .icobox{margin-left:-0.3em; width:2.2em;height:2.2em; font-size:1em; box-sizing:border-box;}
.searchbox2 .icobox image{width: 1.5em; height:1.5em; margin-top: 0.4em; margin-left: 0.6em;}
.searchbox2 .icobox0{width:2.2em;height:2.2em; font-size:1em; box-sizing:border-box;margin-left: 0.6em;}
.searchbox2 .icobox0 image{width: 1.8em; height:1.8em; margin-top: 0.2em; margin-left: 0.4em;}
.searchbox{ display: flex; z-index: 100; flex-direction: row; margin:0;width:100%; padding:0.8em; padding-top: 0; box-sizing: border-box; }
.searchbox .inpubox{flex-grow: 1;margin:0; height:2.2em; box-sizing:border-box;}
.searchbox .inpubox input{ margin:0; padding-left:2.3em; width: 100%; font-size:1em; height:2.2em; outline: none; text-indent:0;box-sizing:border-box;color:#fff;border:1px solid #1A6D3F;border-radius:0.5em 0 0 0.5em; background-color:#1D7946;}
.searchbox .icobox{margin-right:-2.3em; width:2.2em;height:2.2em;box-sizing:border-box;z-index: 101;}
.searchbox .icobox image{width: 1.5em; height:1.5em; margin-top: 0.4em; margin-left: 0.6em;}
.searchbox .icobox0{margin:0; margin-left:0.5em; margin-top:0.2em; width:1.8em;height:1.8em; box-sizing:border-box;z-index: 101;border-radius:50%;}
.searchbox .icobox0 image{width: 1.5em; height:1.5em; margin-top: 0.1em; margin-left: 0.1em;}
.searchbox .searchicobox{margin:0; margin-left:0em; width:3em;height:2.2em; line-height: 2.2em; box-sizing:border-box;z-index: 102;background:linear-gradient(to right,#1D7946,#1D7946); border:1px solid #1A6D3F; border-left:0; color:#fff; text-align: center; border-radius:0 0.5em 0.5em 0;}
.swiper{
width:100%;
background-color: #fff;
border-radius:0.5em;
padding: 0.8em;
box-sizing: border-box;
}
.swiper_box {
width: 100%;
min-height: 14em;
}
swiper-item image {
width: 100%;
height: 100%;
display: inline-block;
}
.menudata_box{
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding:0.8em;
box-sizing: border-box;
z-index: 10;
}
.menudata_box view{
display:block;
float:left;
width: 100%;
padding: 0.4em 0;
padding-bottom: 0.4em;
border-radius:0.5em;
background-color:#fff;
box-sizing: border-box;
}
.menudata_box view .swiper_box0 {
display:block;
float:left;
width: 100%;
height:11em;
}
.menudata_box .swiper_box0 .wx-swiper-dots{bottom: 0em;}
.menudata_box view view{
float: left;
display: flex;
width: 25%;
height: 6em;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size:0.8em;
}
.menudata_box view view image{
width: 3em;
height: 3em;
padding:0;
background-color: #f5f5f5;
border-radius:0.4em;
overflow: hidden;
box-sizing: border-box;
}
.menudata_box view view text{
margin-top: 0.4em;
}
.business_box {
width: 100%;
padding: 0 0.8em;
margin-bottom: 6em;
box-sizing: border-box;
}
.business_item {
width: 100%;
background-color: #fff;
border-radius: 0.7em;
margin-bottom: 0.8em;
padding: 0.6em;
box-sizing: border-box;
}
.business_item .business_item_top {
display: flex;
flex-direction: row;
width: 100%;
}
.business_item .business_item_top .item_image {
width: 5em;
height: 5em;
margin-right: 0.6em;
border: 1px solid #f1f1f1;
}
.business_item .business_item_top .item_image image {
width: 100%;
height: 100%;
}
.business_item .business_item_top .item_info {
width: 12em;
}
.business_item .business_item_top .item_info .item_title {
font-size: 1em;
width: 100%;
}
.business_item .business_item_top .item_info .item_distance {
margin-top: 0.5em;
font-size: 1em;
color: #939393;
width: 100%;
}
.item_distance_box {
display: flex;
flex-direction: row;
width: 100%;
}
.item_distance_box .addressico {
margin-left: 0.5em;
width: 1.2em;
height: 1.2em;
}
.item_distance_box .addressico image {
width: 100%;
height: 100%;
}
.business_item .business_item_top .item_info{
flex-grow: 1;
}
.business_item .business_item_top .item_info view.item_address {
display: flex;
flex-direction: row;
margin-top: 0.5em;
font-size: 1em;
color: #939393;
width: 100%;
}
.business_item .business_item_top .item_info view.item_address .ico {
width: 1.4em;
height: 1.4em;
}
.business_item .business_item_top .item_info view.item_address .ico .ico_box {
width: 100%;
height: 100%;
}
.business_item .business_item_top .item_info view.item_address .ico image {
width: 100%;
height: 100%;
}
.business_item .business_item_bottom {
margin-top: 0.6em;
padding-top: 0.6em;
box-sizing: border-box;
width: 100%;
border-top: 1px solid #f1f1f1;
}
.business_item .item_product .product_image {
width: 100%;
}
.business_item .item_product .product_image image {
width: 5em;
height: 5em;
}
.business_item .item_product .products_title {
width: 100%;
}
.business_item .item_product .products_price {
width: 100%;
}
.business_item .item_product .products_price text {
color: #ff4d00;
}
.business_item .item_product .products_price del {
color: #939393;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

143
pages/businessview/index.js Normal file
View File

@@ -0,0 +1,143 @@
var WxParse = null;
var app = getApp()
var that=null
Page( {
data: {
loadingHidden:false,
nodataHidden:true,
indicatorDots: false,
indicatorDots0: true,
vertical: false,
vertical0: false,
autoplay: true,
interval: 6000,
interval0: 8000,
duration: 1000,
duration0: 1000,
viewid:0,
showpic:0,
title:"",
products:[],
images:[],
Start:0,
latitude:"",
longitude:"",
distance:"",
address:"",
fwbody:""
},
onLoad: function(options) {
that = this
if(options.id){
that.setData({
viewid: options.id
});
}
that.clearCache();//清本页缓存
that.getlist(0);//第一次加载数据
},
// 下拉刷新
onPullDownRefresh: function () {
that.clearCache();
that.getlist(0);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.getlist(1);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
products: [],
Start: 0,
loadingHidden:false
});
}, getlist: function (gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var latitude = wx.getStorageSync("latitude")
var longitude = wx.getStorageSync("longitude")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getbusinessview",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
latitude:(!latitude?"":latitude),
longitude:(!LoginId?"":longitude),
viewId:that.data.viewid,
Start:that.data.Start
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
var tmpArr = null;
tmpArr = that.data.products;
if(res.data.productlist.length>0){
tmpArr.push.apply(tmpArr,res.data.productlist);
}
that.setData({
products: tmpArr,
Start: that.data.Start+res.data.productlist.length,
showpic:res.data.showpic,
loadingHidden:true
})
if(gp==0||gp==1){
that.setData({
images:res.data.pic,
title:res.data.name,
address:res.data.address,
distance:res.data.distance,
longitude:res.data.lon,
latitude:res.data.lat,
fwbody:res.data.fwbody,
})
if(res.data.productlist.length==0){
that.setData({
nodataHidden:false
})
}else{
that.setData({
nodataHidden:true
})
}
}
}
})
},swiperchange:function(e) {
},closeserver:function(e) {
that.setData({
bodyHidden:true
})
},inserver :function(e) {
},onamap:function(e) {
var address = that.data.address
var lat = that.data.latitude
var lon = that.data.longitude
wx.navigateTo({
url: "../map/index?lat=" + lon + "&lon=" + lat + "&address=" + address
})
},oncopy0:function(e) {
var address = that.data.address
wx.setClipboardData({
data: address,
success: function (res) {
wx.showToast({
title: "复制成功"
})
}
})
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "商家详情"
}

View File

@@ -0,0 +1,73 @@
<view class="container">
<view class="container0" wx:if="{{showpic==0}}">
<view class="swiper" style="padding: 0.8em;">
<swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{images}}" wx:key="index">
<swiper-item bindtap="onslide" data-id="{{item.img}}">
<image src="{{item.img}}" class="slide-image"/>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="business_view">
<view class="view_title">{{title}}</view>
<view class="view_distance">
<view class="view_distance_box">
<view class="ub-f1">距您直线距离<span id="distance_box">{{distance}}</span>
</view>
<view class="ico" catchtap="inserver">
<image src="../../images/Pin-Assistor.png" bindtap="onamap" />
</view>
</view>
</view>
<view class="ub view_address">
<view class="ub-f1">
地址:<span id="address_box">{{address}}</span>
</view>
<view class="ub ico" catchtap="inserver">
<image src="../../images/copy.png" bindtap="oncopy0" />
</view>
</view>
<view class="view_fwbody">
服务内容:<view id="fwbody_box">{{fwbody}}</view>
</view>
</view>
<view class="choice_box" wx-if='{{Products.length>0}}'>
<view class="choice_box_to">
<view class="text">
<view class="line_flag"></view>
<text>商品列表</text>
</view>
<view class="choice_list">
<view class="choice_item" wx:for="{{Products}}" wx:key="index" bindtap="gotodetail" data-id="{{item._id}}">
<view class="choice_item_box">
<view class="choice_image">
<view class="choice_image_box">
<image src="{{item.image}}"></image>
</view>
</view>
<view class="right_title">
<view class="right_name" >{{item.name}}</view>
<view class="jeto">
<view class="scje">零售价:<text>¥{{item.scje}}</text>
</view>
<view class="hyje">会员价:<text>¥{{item.hyje}}</text>
</view>
</view>
<view class="right_button" >
<view>立即抢购</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,250 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
padding: 0;
box-sizing: border-box;
}
.container0{
margin-top: 0em;
padding: 0.8em;
box-sizing: border-box;
}
.swiper{
width:100%;
background-color: #fff;
border-radius:0.5em;
padding: 0.8em;
box-sizing: border-box;
}
.swiper_box {
width: 100%;
min-height: 14em;
}
swiper-item image {
width: 100%;
height: 100%;
display: inline-block;
}
.business_view {
width: 100%;
padding: 0 0.8em;
padding-bottom: 0.8em;
background-color: #fff;
box-sizing: border-box;
color: #939393;
line-height: 2em;
}
.view_title {
display: flex;
flex-direction: row;
width: 100%;
font-size: 1em;
font-weight: 900;
color:#000;
}
.view_distance {
width: 100%;
}
.view_distance .view_distance_box {
display: flex;
flex-direction: row;
width: 100%;
}
.view_distance .view_distance_box .ico {
margin-left: 0.5em;
margin-top: 0.3em;
width: 1.2em;
height: 1.2em;
}
.view_distance .view_distance_box .ico image {
width: 100%;
height: 100%;
}
.view_address {
display: flex;
flex-direction: row;
width: 100%;
}
.view_address .ico {
margin-top: 0.3em;
width: 1.4em;
height: 1.4em;
}
.view_address .ico image {
width: 100%;
height: 100%;
}
.view_fwbody {
width: 100%;
}
.text{
margin-top: 0;
line-height: 2.5em;
display: flex;
flex-direction: row;
align-items: center;
}
.text .line_flag{
margin-top: 0em;
margin-left: 0.5em;
margin-right: 0.5em;
width:0.5em;
height: 1.5em;
line-height: 1.5em;
background-color: #f0514d;
border-radius:0.2em;
}
.text .line_more{
flex: 1;
text-align: right;
align-self: center;
color:#ff0000
}
.choice_box {
margin-top:0em;
margin-bottom:4em;
padding:0.8em;
z-index:11;
box-sizing: border-box;
}
.choice_box .choice_box_to{
padding:0;
background-color:#ffffff;
box-sizing: border-box;
border-radius:0.5em;
}
.choice_box .choice_box_to .text{
}
.choice_box .choice_box_to .text .line_flag{
background-color: #00B050;
}
.choice_box .choice_list .choice_item{
padding:0;
display: flex;
flex-direction: column;
border-bottom: 1px solid #f1f1f1;
}
.choice_box .choice_list .choice_item .choice_item_box{
padding:0;
display: flex;
flex-direction: row;
}
.choice_box .choice_list .choice_item .choice_image{
float:left;
position: relative;
display: block;
width: 42%;
height: 10em;
padding: 1em;
box-sizing: border-box;
overflow: hidden;
}
.choice_box .choice_list .choice_item .choice_image_box{
float:left;
position: relative;
display: block;
width: 100%;
height: 100%;
}
.choice_box .choice_list .choice_item .choice_image_box image {
width: 100%;
height: 100%;
}
.choice_box .choice_list .choice_item .choice_image_box .YPTNum{
position: absolute;
bottom:0;
left:0;
line-height: 2em;
font-size: 1em;
width:100%;
text-align: center;
background:rgba(0, 0, 0, 0.5);
color:#fff;
}
.choice_box .choice_list .right_title{
float:left;
display: flex;
flex-direction:column;
box-sizing: border-box;
padding:1em;
padding-left: 0;
width:58%;
height: 10em;
}
.choice_box .choice_list .right_name {
float:left;
margin-bottom: 0.5em;
display:block;
width:100%;
height:3em;
text-align: left;
overflow: hidden;
}
.choice_box .choice_list .jeto{
display: flex;
flex-direction:column;
font-size: 0.85em;
color:#848484;
}
.choice_box .choice_list .jeto .scje{
text-decoration:line-through;
}
.choice_box .choice_list .jeto .hyje{
color: #ff4d00;
line-height:1.5em;
margin-top: 0.2em;
}
.choice_box .choice_list .right_button {
float:left;
display:block;
margin:0;
margin-top: 0.5em;
width:100%;
}
.choice_box .choice_list .right_button view{
float:right;
display:block;
margin:0;
width:6em;
text-align: center;
padding:0.2em 0.5em;
box-sizing: border-box;
background:linear-gradient(to right,#00B050,#00B050);
color:#fff;
border-radius:0.5em;
overflow: hidden;
}
.choice_box .choice_list .right_button view.visited{
background:linear-gradient(to left,#e1e1e1,#e8e8e8);
border:1px solid #dfdfdf;
color:#aaa;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

311
pages/cart/index.js Normal file
View File

@@ -0,0 +1,311 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
cartImg: '../../images/cart-null.png',
tipWords: '购物车空空如也',
productHidden:false,
noproductHidden:true,
loadingHidden:false,
footerHidden:false,
ttype:0,
cartproducts:[],
cart_Total:"¥0.00",
cart_Total_title:"总计(不包含运费)"
},
onLoad: function() {
that = this
that.rdata(0)
sopenFrame=setInterval(function (){
if(app.globalData.IFRefreshCart==1){
that.rdata(0)
app.globalData.IFRefreshCart=0
}
}, 1000);
},onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.rdata(1)
},rdata: function(t) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var CartId = wx.getStorageSync("CartId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getshopcart",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
CartId:(!CartId?"":CartId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
that.setData({
ttype:res.data.ttype,
cartproducts:res.data.productlist,
loadingHidden:true,
cart_Total:"¥"+res.data.ZSubTotal
})
if(res.data.ttype==0){
that.setData({
cart_Total:"兑换券"+res.data.ZSubTotal
})
}
if(res.data.productlist.length>0){
that.setData({
productHidden:false,
noproductHidden:true,
footerHidden:false
})
}else{
that.setData({
productHidden:true,
noproductHidden:false,
footerHidden:true
})
}
}else{
if(res.data.msg=="您未登录"||res.data.msg=="参数错误"){
wx.removeStorageSync('userId')
wx.removeStorageSync('LoginId')
that.rdata(0)
}
}
if(t==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},updatenum:function(e) {
var datavalue = e.currentTarget.dataset.id.split(":")
var t=datavalue[0]
var id=datavalue[1]
var index=datavalue[2]
var prodNum=that.data.cartproducts[index].prodNum
var TotalNum=that.data.cartproducts[index].TotalNum
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var CartId = wx.getStorageSync("CartId")
var bb=true
var a=prodNum
if(t==1){
var c=/^[0-9]*$/
if (!c.test(a)) {
a = 1
wx.showToast({
title: "输入的数量有误,应为[1-999]",
icon: "none",
duration: 2000
})
bb=false
}
if(bb){
var b = parseInt(a) + 1
if (b > 999) {
b = 999
}
var e = TotalNum;
e = parseInt(e);
if (b > e) {
wx.showToast({
title: "库存不足",
icon: "none",
duration: 2000
})
b = e
bb=false
}
a=b
}
}else if(t==2){
var c = /^[0-9]*$/;
if (!c.test(a)) {
a = 1
wx.showToast({
title: "输入的数量有误,应为[1-999]",
icon: "none",
duration: 2000
})
bb=false
}
if(bb){
var b = parseInt(a) - 1
var zkc = TotalNum
if (b > 999) {
b = 999
}
if (b > zkc) {
b = zkc
}
if (b <= 0) {
wx.showToast({
title: "输入的数量有误,应为[1-999]",
icon: "none",
duration: 2000
})
b = 1
bb=false
}
a=b
}
}else{
var zkc=parseInt(TotalNum);
if(e.detail.value!=""){
a=parseInt(e.detail.value);
}else{
bb=false
}
if (a > zkc) {
a = zkc
}
if (a < 1) {
a = 1
}
}
if(bb){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"updateshopcart",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
CartId:(!CartId?"":CartId),
num:a,
id:id
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
that.setData({
ttype:res.data.ttype,
cartproducts:res.data.productlist,
cart_Total:(res.data.ttype==1?"¥":"")+res.data.ZSubTotal+(res.data.ttype==0?"积分":"")
})
if(res.data.productlist.length>0){
that.setData({
productHidden:false,
noproductHidden:true
})
}else{
that.setData({
productHidden:true,
noproductHidden:false
})
}
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},delcart:function(e) {
wx.showModal({
title: '删除提示',
content: '此操作不可恢复!您确认要删除吗?',
success (res0) {
if (res0.confirm) {
var id = e.currentTarget.dataset.id
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var CartId = wx.getStorageSync("CartId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"delshopcart",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
CartId:(!CartId?"":CartId),
id:id
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
that.setData({
ttype:res.data.ttype,
cartproducts:res.data.productlist,
cart_Total:(res.data.ttype==1?"¥":"")+res.data.ZSubTotal+(res.data.ttype==0?"积分":"")
})
if(res.data.productlist.length>0){
that.setData({
productHidden:false,
noproductHidden:true
})
}else{
that.setData({
productHidden:true,
noproductHidden:false
})
}
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
} else if (res0.cancel) {
}
}
})
},Shop_Pay:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
wx.navigateTo({
url: "../sell/index"
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},gotodetail:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../details/index?id="+id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
}
})

3
pages/cart/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "购物车"
}

43
pages/cart/index.wxml Normal file
View File

@@ -0,0 +1,43 @@
<view class="container">
<view class="cart-product" wx:for="{{cartproducts}}" wx:for-index="index" hidden="{{productHidden}}">
<view class="cart-product-item" color="{{item.selcolor}}" guige="{{item.guige}}">
<view class="limg" bindtap="gotodetail" data-id="{{item.prodid}}">
<image src="{{item.prodimg}}" />
</view>
<view class="rname">
<view class="prodName" bindtap="gotodetail" data-id="{{item.prodid}}">{{item.prodName}} {{item.selcolor}}
</view>
<view class="je">单价:<text>{{ttype==0?"兑换券":"¥"}}{{item.prodPrice}}</text> 小计:
<text>{{ttype==0?"兑换券":"¥"}}{{item.SubTotal}}</text>
</view>
<view class="tnum">
<view class="input_del" bindtap="updatenum" data-id="2:{{item.id}}:{{index}}"></view>
<input name="Nums" id="Num{{item.id}}" type="text" class="input_text" bindinput="updatenum" data-id="0:{{item.id}}:{{index}}" value="{{item.prodNum}}"/>
<view class="input_add" bindtap="updatenum" data-id="1:{{item.id}}:{{index}}">
</view>
<view class="Inventory">库存:{{item.TotalNum}}</view>
</view>
</view>
<view class="icon" bindtap="delcart" data-id="{{item.id}}"><image src="../../images/close.png" />
</view>
</view>
</view>
<view class="floor-noproduct" hidden="{{noproductHidden}}">
<image src="{{cartImg}}" class="cart-image"/>
<view>{{tipWords}}</view>
</view>
</view>
<view class="footer" hidden="{{footerHidden}}">
<view class="cartmbox">
<view class="leftbox">
<text class="cart_Total_title">{{cart_Total_title}}</text>
<text class="cart_Total">{{cart_Total}}</text>
</view>
<view class="rightbox">
<button bindtap="Shop_Pay" class="input_shopdh" >去结算</button>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

62
pages/cart/index.wxss Normal file
View File

@@ -0,0 +1,62 @@
page{
background: #ccc;
}
button::before {
border:none;
}
button::after {
border:none;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.floor-noproduct{display: flex; flex-direction: column; align-items: center; justify-content: center;}
.container .cart-image {
width: 120px;
height: 120px;
}
.footer{
position: fixed;
z-index: 10000;
bottom:0;
left:0;
height: 50px;
width: 100%;
background-color: #fff;
color: white;
text-align: center;
border-top: 1px solid #e1e1e1;
font-size:12px;
}
.cartmbox{float:left;margin:0; padding:0; width:100%; height:100%;}
.cartmbox .leftbox{float:left;position:relative;margin:0; padding:0; padding-left:1em; color: #000;font-size:1em; height:100%;line-height:50px;}
.cartmbox .leftbox text.cart_Total{font-style:normal; font-weight:bold; color:#ff0000;}
.cartmbox .rightbox{float:right;margin:0;padding-right:1em;height:100%; line-height:100%;}
.cartmbox .rightbox button{float:right; margin:0.7em 0; padding:0; width:6em; height:2.5em; line-height:2.5em; display:block; border:0; font-size: 1em; background-color:#fe6e09;border-radius:3px; color:#fff; border:0;border-radius:0 2em 2em 0;border:0;}
.cartmbox .rightbox button.input_shopcart,.cartmbox .rightbox button.input_shopdh{background: linear-gradient(to left,#ff9615,#fec811);border-radius:2em 0 0 2em;}
.cartmbox .rightbox button.input_shopdh{border-radius:2em;width:7em;}
.cartmbox .rightbox button[disabled='true']{background:#bbb;}
.cartmbox .rightbox button.input_shopdh[disabled='true']{width:7em;background:#bbb;border-radius:2em;}
.cart-product{float:left;width:100%;}
.cart-product .cart-product-item{float:left; margin:0.5em 0; padding:1em; width:100%; overflow:hidden; position:relative; border:1px solid #dfdfdf; border-left:0;border-right:0; background-color:#fff;box-sizing:border-box;}
.cart-product .cart-product-item .limg{float:left; display: flex; width:25%;display:block; overflow: hidden;box-sizing:border-box;}
.cart-product .cart-product-item .limg image{width:4em; height:4em;}
.cart-product .cart-product-item .rname{float:left;display: flex; padding-left:0.6em; display:block; width:70%; overflow:hidden;box-sizing:border-box;}
.cart-product .cart-product-item .rname view{float:left;display:block;width:100%;padding-left:0;font-size: 12px;}
.cart-product .cart-product-item .rname view.prodName{float:left; display:block;width:100%; }
.cart-product .cart-product-item .rname view.je{ margin-top:0.5em;}
.cart-product .cart-product-item .rname text{ font-style:normal; color:#ff0000;}
.cart-product .cart-product-item .rname view.je del{ font-style:normal; font-size:1em; font-weight:bold; color:#939393;}
.cart-product .cart-product-item .rname view.tnum{margin-top:0.8em;}
.cart-product .cart-product-item .rname view.tnum view,.cart-product .cart-product-item .rname view.tnum input{float:left; display: block; height:2.2em;width:2.2em;box-sizing: border-box; overflow: hidden;}
.cart-product .cart-product-item .rname view.tnum input{float:left; display: block;border:1px solid #c2c2c0;border-left:0;border-right:0;font-size:1em; text-align:center;}
.cart-product .cart-product-item .rname view.tnum view.input_del{background: url('data:image/png;base64,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') no-repeat 0px 0px; background-size:100% 100%;}
.cart-product .cart-product-item .rname view.tnum view.input_add{background: url('data:image/png;base64,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') no-repeat 0px 0px; background-size:100% 100%;}
.cart-product .cart-product-item .rname view.tnum view.Inventory{width:6em;line-height:2em; text-align:center;}
.cart-product .cart-product-item .icon{position:absolute; right:0.8em; top:0.5em;width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box; overflow: hidden;}
.cart-product .cart-product-item .icon image{width:100%;height:100%;}

127
pages/checkin_log/index.js Normal file
View File

@@ -0,0 +1,127 @@
var app = getApp()
var that = null
var sopenFrame = null
Page({
data: {
balanceImg: '../../images/order-null.png',
tipWords: '亲,暂时没有数据哦!',
balanceHidden: false,
nobalanceHidden: true,
loadingHidden: false,
mybalance: [],
Start: 0,
ZZEnable: 1,
TXEnable: 0,
nav: 0,
},
onLoad: function (options) {
that = this
if (options.t) {
that.setData({
nav: options.t
});
}
sopenFrame = setInterval(function () {
if (app.globalData.IFRefreshmybalance == 1) {
app.globalData.IFRefreshmybalance = 0
that.clearCache(); //清本页缓存
that.getlist(0)
}
}, 1000);
that.clearCache(); //清本页缓存
that.getlist(0)
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1); //第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
if (that.data.loadingHidden) {
that.setData({
loadingHidden: false
});
that.getlist(2); //后台获取新数据并追加渲染
} else {
wx.hideLoading();
}
},
// 清缓存
clearCache: function () {
that.setData({
balanceHidden: false,
nobalanceHidden: true,
loadingHidden: false,
Start: 0,
mybalance: []
});
},
getlist: function (gp) {
that = this
var userId = wx.getStorageSync("userId")
wx.request({
url: app.globalData.apiurl + "/api/api.ashx?action=user_sign_list",
data: {
userId: (userId == null ? "" : userId)
},
method: "POST",
dataType: "json",
header: {
"content-type": "application/x-www-form-urlencoded"
},
success(res) {
if (res.data.status == 1) {
var tmpArr = null;
tmpArr = that.data.mybalance;
tmpArr.push.apply(tmpArr, res.data.listResult);
that.setData({
mybalance: tmpArr,
Start: that.data.Start + res.data.listResult.length,
loadingHidden: true
})
if (gp == 0 || gp == 1) {
if (res.data.listResult.length > 0) {
that.setData({
balanceHidden: false,
nobalanceHidden: true
})
} else {
that.setData({
balanceHidden: true,
nobalanceHidden: false
})
}
}
}
if (gp == 1) {
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},
onnav: function (e) {
var index = e.currentTarget.dataset.id
that.setData({
nav: index
})
that.clearCache();
that.getlist(0);
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "用户签到明细"
}

View File

@@ -0,0 +1,44 @@
<view class="container">
<!-- <view class="button_box" wx:if="{{nav==1&&TXEnable==0}}">
<view class="button_box_item" style="width:100%" wx:if="{{nav==11}}">
<view class="mybtn" bindtap="onzz">互转</view>
</view>
<view class="button_box_item" wx:if="{{nav==11}}">
<view class="mybtn" bindtap="onzz">互转</view>
</view>
<view class="button_box_item" wx:if="{{nav==1}}">
<view class="mybtn" bindtap="ontx">提现</view>
</view>
<view class="button_box_item" style="width:100%" wx:if="{{nav==2}}">
<view class="mybtn" bindtap="onzh">划转流量积分</view>
</view>
</view> -->
<view class="mybalance-box" hidden="{{balanceHidden}}">
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index" wx:key="id">
<view class="Total">
<view><text>兑换券增减:</text>{{item.ClassId==1?"+"+item.Point:"-"+item.Point}}</view>
<view class="right"><text>余额:</text>{{item.AfterPoint}}</view>
</view>
<view>
<text>时间:</text>{{item.CreateDay}}
</view>
<view>
<text>备注:</text>{{item.Remark}}
</view>
</view>
</view>
<view class="nodata" hidden="{{nobalanceHidden}}">
<image src="../../images/order-null.png"/>
<view>暂无数据</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,67 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.container .balance-image {
width: 80px;
height: 80px;
}
.button_box{
display: flex;
flex-direction: row;
margin: 0;
padding:0;
padding-right: 0.8em;
box-sizing: border-box;
align-items: center;
justify-content: center;
background-color: #fff;
}
.button_box .button_box_item{
display: flex;
flex-direction: column;
flex-grow: 1;
width:50%;
height:2.5em;
margin: 0;
padding: 0.8em;
padding-right: 0;
}
.button_box .button_box_item .mybtn{
width: 100%;
height: 100%;
border-radius: 0.4em;
background-color: #00B050;
color:#fff;
line-height: 2.5em;
text-align: center;
}
.mybalance-menu{display: flex;flex-direction: row;align-items: center;justify-content: center;width:100%; background-color: #fff;}
.mybalance-menu view{width:25%; height:2.5em; line-height: 2.5em; text-align: center; border:1px solid #f1f1f1; border-left:0;border-top: 0;}
.mybalance-menu view.hover{border-bottom:1px solid #ff4d00;}
.mybalance-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;padding:0.8em; box-sizing: border-box;}
.mybalance-item{width:100%;display: flex;flex-direction: column; align-items: center;justify-content: center;box-sizing: border-box; padding:0.5em 0.8em; margin:0.8em 0; margin-top: 0; line-height: 2em; background-color:#fff;border-radius:0.5em;}
.mybalance-item view{width:100%;flex-direction: row; align-items: center;justify-content:left;color: #939393;}
.mybalance-item view text{color: #000;}
.mybalance-item view text.Totalprice{ margin-left: 1em;}
.mybalance-item view.Total{float: left; display: block;}
.mybalance-item view.Total view{float: left; display: block;width:auto; margin:0; padding:0;color:#ff4d00; box-sizing: border-box; overflow: hidden;}
.mybalance-item view.Total view.right{float:right;}
.mybalance-item view.Total view text{float: left; display: block;width:auto;color: #000;}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

166
pages/classify/index.js Normal file
View File

@@ -0,0 +1,166 @@
var app = getApp()
var that = null
Page({
data: {
navLeftItems: [],
navRightItems:[],
products: [],
Start: 0,
categoryid: 0,
categoryid0: 0,
navindex:0,
navindex0:-1,
loadingHidden:false
},
// 页面加载
onLoad: function () {
that = this
that.getlist(0);//第一次加载数据
},
// 下拉刷新
onPullDownRefresh: function () {
that.clearCache();
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
products: [],
Start: 0,
loadingHidden:false
});
},
getlist: function (gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getshopcategory",
categoryid:that.data.categoryid,
categoryid0:that.data.categoryid0,
Start:that.data.Start,
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(that.data.Start==0){
var index=that.data.navindex;
var addlb=[{header:"全部分类",image:"",productlb:[],id:0}];
var productlb = null;
productlb = addlb;
if(productlb,res.data.productlb.length>0){
productlb.push.apply(productlb,res.data.productlb);
}
var productlb2=productlb[index].productlb;
that.setData({
navLeftItems: productlb,
navRightItems: productlb2,
navindex:index
})
}
var tmpArr = null;
tmpArr = that.data.products;
if(res.data.productlist.length>0){
tmpArr.push.apply(tmpArr,res.data.productlist);
}
that.setData({
products: tmpArr,
Start: that.data.Start+res.data.productlist.length,
loadingHidden:true
})
if(gp==0||gp==1){
if(res.data.productlist.length==0){
that.setData({
nodataHidden:false
})
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},
//事件处理函数
switchRightTab: function(e) {
var index = e.target.dataset.id;
var categoryid=that.data.navLeftItems[index].id;
var productlb2=that.data.navLeftItems[index].productlb;
that.clearCache();
that.setData({
Start:0,
navindex:index,
navindex0:-1,
categoryid:categoryid,
categoryid0:0,
navRightItems: productlb2
})
that.getlist(1);
},
//事件处理函数
switchRightTab0: function(e) {
var index = e.target.dataset.id;
var categoryid0=0;
if(index>-1){
var productlb2=that.data.navLeftItems[that.data.navindex].productlb;
categoryid0=productlb2[index].id;
}
that.clearCache();
that.setData({
Start:0,
navindex0:index,
categoryid0: categoryid0
})
that.getlist(1);
},ondetail:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../details/index?id="+id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "分类"
}

43
pages/classify/index.wxml Normal file
View File

@@ -0,0 +1,43 @@
<view class="container">
<view class="nav_left">
<block wx:for="{{navLeftItems}}" wx:for-index="index">
<view class="nav_left_items {{index==navindex?'active':''}}" bindtap="switchRightTab" data-id="{{index}}">{{item.header}}</view>
</block>
</view>
<view class="nav_right">
<view wx:if="{{categoryid>0&&navRightItems.length>0}}" style="width:100%;overflow-x: auto;">
<view style="width:200%;">
<view class="nav_right_item {{navindex0==-1?'active':''}}" bindtap="switchRightTab0" data-id="-1">
全部分类
</view>
<block wx:for="{{navRightItems}}" wx:for-index="index">
<view class="nav_right_item {{index==navindex0?'active':''}}" bindtap="switchRightTab0" data-id="{{index}}">
{{item.header}}
</view>
</block>
</view>
</view>
<view class="clear"></view>
<view wx:if="{{products}}">
<view wx:for="{{products}}" class="brand_item" bindtap="ondetail" data-id="{{item._id}}">
<image src="{{item.image}}" class="pic"></image>
<view class="brand_item_cont">
<text class="name">{{item.name}}</text>
<view class="price">
<!--<text class="marketprice">¥{{item.scje}}</text>-->
<text class="ourprice">¥{{item.hyje}}</text>
</view>
</view>
</view>
</view>
<view wx:else>暂无数据</view>
</view>
</view>

97
pages/classify/index.wxss Normal file
View File

@@ -0,0 +1,97 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.nav_left{
width: 25%;
height: 100vh;
background: #f5f5f5;
text-align: center;
overflow: hidden;
overflow-y: auto;
position: fixed;
left:0;
top:0;
}
.nav_left .nav_left_items{
height: 30px;
line-height: 30px;
padding: 6px 0;
border-bottom: 1px solid #dedede;
}
.nav_left .nav_left_items.active{
background: #fff;
}
.nav_right{
position: absolute;
right: 0;
top:0;
width: 75%;
min-height: 100vh;
margin: 0;
padding: 5px;
background: #fff;
box-sizing: border-box;
}
.nav_right .nav_right_item{
float: left;
width: auto;
text-align: center;
padding:5px;
box-sizing: border-box;
background: #ccc;
border: 1px solid #f1f1f1;
}
.nav_right .nav_right_item.active{
background: #fff;
border: 1px solid #f1f1f1;
}
.container .brand_item{
float: left;
width:50%;
margin:0;
padding:1em;
background-color: #fff;
border: 1px solid #f1f1f1;
box-sizing: border-box;
text-align: center;
overflow: hidden;
}
.container .brand_item .pic{
width: 6em;
height: 6em;
}
.container .brand_item .pic image{
width: 100%;
height: 100%;
}
.brand_item_cont{
width: 100%;
}
.brand_item_cont .name{
margin: 10px 0;
margin-bottom: 5px;
display: block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.brand_item_cont .ourprice{
color: #ff4d00;
font-weight: bold;
}
.brand_item_cont .marketprice{
text-decoration: line-through;
color: #939393;
}

1301
pages/details/index.js Normal file

File diff suppressed because it is too large Load Diff

3
pages/details/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "商品详情"
}

228
pages/details/index.wxml Normal file
View File

@@ -0,0 +1,228 @@
<import src="../../wxParse/wxParse.wxml"/>
<view class="container">
<view>
<swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{showimages}}">
<swiper-item>
<image src="{{item.img}}" bindtap="viewimages0" data-index="{{index}}" class="slide-image"/>
</swiper-item>
</block>
</swiper>
</view>
<view class="shopping_container">
<view class="title">{{title}}</view>
<view class="price" style="margin-bottom: 0; padding-bottom: 0;">
<text class="currentprice">{{oldpricetitle}}<text>¥{{oldprice}}</text></text>
<text class="currentprice" style="margin-left:5px;">{{currenttitle}}<text>{{currentprice}}</text></text>
</view>
<view class="price" wx:if="{{ttype==12||ttype==14}}">
<text class="currentprice">可用补贴券:<text>{{currentprice0}}</text></text>
</view>
<view class="spell_list" wx:if="{{ttype==6}}">
<view class="title"><text>{{spell_list.length}}</text>人在发起拼团,可直接参与</view>
<swiper class="swiper_box0" wx:if="{{spell_list.length>0}}" indicator-dots="{{indicatorDots0}}" vertical="{{vertical0}}"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" display-multiple-items="{{spell_list.length==1?1:2}}">
<swiper-item wx:for="{{spell_list}}">
<view class="swiper-item">
<view class="leftbox">
<image src="{{item.UserPic}}" class="slide-image"/>
<view class="name">{{item.NCName}}</view>
</view>
<view class="rightbox">
<view class="spell_num_time">
<view class="spell_num">还差<text>{{item.PCount}}</text>人完成</view>
<view class="spell_time">正在拼团中</view>
</view>
<view class="button" bindtap="onpd" data-id="{{item.id}}">加入拼团</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
</view>
</view>
</view>
<view class="footer">
<view class="cartmbox">
<view class="leftbox">
<view class="leftbox_button" bindtap="showserver">
<image src="../../images/server.png" />
<text>客服</text>
</view>
<view class="leftbox_button" bindtap="addfavorite" style=" margin-left:1em;width:3em;">
<image src="../../images/favorite.png" id="addfavoriteimg" />
<text id="addfavorite">{{favorite}}</text>
</view>
<view class="leftbox_ShoppingCart" style=" margin-left:1em;" bindtap="showcart">
<text></text>
<view class="cartnum" id="cartcount">{{cartcount}}</view>
</view>
</view>
<view class="rightbox">
<view bindtap="addcart" data-id="1" class='input_shopdh' ><view class="price">{{ttype==6?currentprice:""}}</view><view class='{{ttype==6?"":"button_font"}}'>{{(ttype==5)?"立即领取":(ttype==6?(IFPD>0?"加入拼团":"加入拼团"):(ttype==7?"立即申请":(ttype==8?"立即预定":"立即购买")))}}</view></view>
<view bindtap="addcart" class="input_shopdh input_shopcart" data-id="0" wx:if="{{ttype==0}}"><view class="price">{{ttype==6?"¥"+oldprice:""}}</view><view class='{{ttype==6?"":"button_font"}}'>{{(ttype==6)?"单独购买":"加入购物车"}}</view></view>
<view class='IFPD_Box {{yqpdname=="请点击下方按钮参与体验"?"ifpt0":""}}' wx:if="{{ttype==6&&IFPD>0}}">
<view class='IFPD_Box_msg'>
{{yqpdname}}
<view class="close" bindtap="closeIFPD"><image src="../../images/close.png" /></view>
</view>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{serverHidden}}" bindtap="closeserver">
<view class="Hidden_box_to" catchtap="inserver">
<view class="close" bindtap="closeserver"><image src="../../images/close.png" /></view>
<view class="body">
<template is="wxParse" data="{{wxParseData:servermsg.nodes}}"/>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{addcartHidden}}" bindtap="closeaddcart">
<view class="Hidden_box_to addcart_box" catchtap="inaddcart">
<view class="close" bindtap="closeaddcart"><image src="../../images/close.png" /></view>
<view class="select_box_pic" bindtap="viewimages"><image src="{{showimage}}"></image></view>
<view class="select_box_title">
<!--<view class="price"><text id="minprice">¥{{minprice}}</text></view>-->
<view class="selguige">
<text class="selguige_font">{{selguige_font}}</text>
<text class="selguige_title">{{selguige_title}}</text>
</view>
</view>
<view class="select_box_selguige" id="guiges" hidden="{{guigesHidden}}">
<view class="selguige_box" wx:for="{{selguiges}}">
<view class="selguige_item {{(item.selectednum>0?'hover':'')}}" data-id="{{index}}">
<view class="select_name">{{item.gg}}<view>兑换券:{{(ttype==6 && addtype==0)?item.jg2:item.jg}}</view><!--<view>金豆:{{item.jg0}}</view>--></view>
<view class="select_colors" wx:if='{{item.colors!=""}}' bindtap="showcolor" data-id="{{index}}">
<view>{{item.selectedcolor==""?"选择颜色":item.selectedcolor}}</view>
</view>
<view class="select_box_selnum">
<view class="select_box_selnum_box">
<view class="num">数量</view>
<view class="addcart_input">
<text class="num_del" bindtap="decrement" data-id="{{index}}"></text>
<input name="product_amount" id="product_amount" type="text" class="input_text" bindinput="inputOnlyNum" value="{{item.selectednum}}" data-id="{{index}}" disabled='' />
<text class="num_add" bindtap="increment" data-id="{{index}}"></text>
</view>
</view>
<view class="productkc">库存:{{item.kc}}</view>
</view>
</view>
</view>
</view>
<view class="select_box_btn">
<button bindtap="qyaddcart" value="{{qyaddcart}}" >{{qyaddcart}}</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{colorHidden}}" bindtap="closecolor">
<view class="Hidden_box_to" catchtap="incolor">
<view class="title">点击下面颜色</view>
<view class="close" bindtap="closecolor"><image src="../../images/close.png" /></view>
<view class="body">
<view class="select_box_selcolor" wx:for="{{selguiges[currentindex].colors}}">
<view bindtap="selcolor" class="selguige_item {{selguiges[currentindex].selectedcolor==item.color?'selected':''}}" data-id="{{index}}"><text></text><view class="guigetit">{{item.color}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="cartmsg" hidden="{{cartmsgHidden}}">
<view class="cartmsg_title">商品已经成功加入</view>
<view class="gotocart" bindtap="gotocart">去付款</view>
<view class="em"></view><view class="icon" bindtap="closemsg"><image src="../../images/close.png" /></view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden0}}" bindtap="closeauth0">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">绑定手机号码</view>
<view class="close" bindtap="closeauth0"><image src="../../images/close.png" /></view>
<view class="body">
<view>为了给您提供更好的服务,需要绑定您的手机号码</view>
<view class="frombody" wx:if="{{!bindPhoneHidden}}">
<form bindsubmit='bindPhone'>
<view class="sendbutton">
<text>手机号码:</text><input name="phone" type="text" bindinput="inputphone" placeholder="填写手机号" value="{{phone}}" /><button id="getPhoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">{{onauthorizetitle0}}</button>
</view>
<view class="sendbutton">
<text>手机验证码:</text><input name="code" class="code" type="text" placeholder="填写验证码" value="" /> <button bindtap="getcode0">{{getcode0}}</button>
</view>
<view class="button">
<!--<button class="qx" bindtap="closeauth0">暂时不绑定</button>--><button form-type="submit">{{savebutton0}}</button>
</view>
</form>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{ptgzHidden}}" bindtap="closeptgz">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">{{ptgztitle}}</view>
<view class="close" bindtap="closeptgz"><image src="../../images/close.png" /></view>
<view class="body">
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:ptgzbody.nodes}}"/>
</view>
<view class="check_box">
<view class='checkbox {{checked==1?"checked":""}}' bindtap="onchecked"></view><view class="fontbox"><text bindtap="onchecked">我已阅读并同意</text><text bindtap="openptgz" class="ptgztitle">《{{ptgztitle0}}》</text></view>
</view>
<view class="button">
<button bindtap="yydptgz">{{ptgzbutton}}</button>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{ptgzHidden0}}" bindtap="closeptgz0">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">{{ptgztitle0}}</view>
<view class="close" bindtap="closeptgz0"><image src="../../images/close.png" /></view>
<view class="body">
<view class="frmbody">
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:ptgzbody0.nodes}}"/>
</view>
</view>
<view class="button">
<button bindtap="yydptgz0">{{ptgzbutton0}}</button>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

423
pages/details/index.wxss Normal file

File diff suppressed because one or more lines are too long

1302
pages/detailsPoint/index.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "商品详情"
}

View File

@@ -0,0 +1,228 @@
<import src="../../wxParse/wxParse.wxml"/>
<view class="container">
<view>
<swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{showimages}}">
<swiper-item>
<image src="{{item.img}}" bindtap="viewimages0" data-index="{{index}}" class="slide-image"/>
</swiper-item>
</block>
</swiper>
</view>
<view class="shopping_container">
<view class="title">{{title}}</view>
<view class="price" style="margin-bottom: 0; padding-bottom: 0;">
<text class="oldprice" style="display:none;">{{oldpricetitle}}<text>¥{{oldprice}}</text></text>
<text class="currentprice">{{currenttitle}}<text>{{currentprice}}</text></text>
</view>
<view class="price" wx:if="{{ttype==12||ttype==14}}">
<text class="currentprice">可用补贴券:<text>{{currentprice0}}</text></text>
</view>
<view class="spell_list" wx:if="{{ttype==6}}">
<view class="title"><text>{{spell_list.length}}</text>人在发起拼团,可直接参与</view>
<swiper class="swiper_box0" wx:if="{{spell_list.length>0}}" indicator-dots="{{indicatorDots0}}" vertical="{{vertical0}}"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" display-multiple-items="{{spell_list.length==1?1:2}}">
<swiper-item wx:for="{{spell_list}}">
<view class="swiper-item">
<view class="leftbox">
<image src="{{item.UserPic}}" class="slide-image"/>
<view class="name">{{item.NCName}}</view>
</view>
<view class="rightbox">
<view class="spell_num_time">
<view class="spell_num">还差<text>{{item.PCount}}</text>人完成</view>
<view class="spell_time">正在拼团中</view>
</view>
<view class="button" bindtap="onpd" data-id="{{item.id}}">加入拼团</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:body.nodes}}"/>
</view>
</view>
</view>
<view class="footer">
<view class="cartmbox">
<view class="leftbox">
<view class="leftbox_button" bindtap="showserver">
<image src="../../images/server.png" />
<text>客服</text>
</view>
<view class="leftbox_button" bindtap="addfavorite" style=" margin-left:1em;width:3em;">
<image src="../../images/favorite.png" id="addfavoriteimg" />
<text id="addfavorite">{{favorite}}</text>
</view>
<view class="leftbox_ShoppingCart" style=" margin-left:1em;" bindtap="showcart">
<text></text>
<view class="cartnum" id="cartcount">{{cartcount}}</view>
</view>
</view>
<view class="rightbox">
<view bindtap="addcart" data-id="1" class='input_shopdh'><view class="price">{{ttype==6?currentprice:""}}</view><view class='{{ttype==6?"":"button_font"}}'>{{(ttype==5)?"立即领取":(ttype==6?(IFPD>0?"加入拼团":"加入拼团"):(ttype==7?"立即申请":(ttype==8?"立即预定":"立即购买")))}}</view></view>
<view bindtap="addcart" class="input_shopdh input_shopcart" data-id="0" wx:if="{{ttype==0}}"><view class="price">{{ttype==6?"¥"+oldprice:""}}</view><view class='{{ttype==6?"":"button_font"}}'>{{(ttype==6)?"单独购买":"加入购物车"}}</view></view>
<view class='IFPD_Box {{yqpdname=="请点击下方按钮参与体验"?"ifpt0":""}}' wx:if="{{ttype==6&&IFPD>0}}">
<view class='IFPD_Box_msg'>
{{yqpdname}}
<view class="close" bindtap="closeIFPD"><image src="../../images/close.png" /></view>
</view>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{serverHidden}}" bindtap="closeserver">
<view class="Hidden_box_to" catchtap="inserver">
<view class="close" bindtap="closeserver"><image src="../../images/close.png" /></view>
<view class="body">
<template is="wxParse" data="{{wxParseData:servermsg.nodes}}"/>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{addcartHidden}}" bindtap="closeaddcart">
<view class="Hidden_box_to addcart_box" catchtap="inaddcart">
<view class="close" bindtap="closeaddcart"><image src="../../images/close.png" /></view>
<view class="select_box_pic" bindtap="viewimages"><image src="{{showimage}}"></image></view>
<view class="select_box_title">
<!--<view class="price"><text id="minprice">¥{{minprice}}</text></view>-->
<view class="selguige">
<text class="selguige_font">{{selguige_font}}</text>
<text class="selguige_title">{{selguige_title}}</text>
</view>
</view>
<view class="select_box_selguige" id="guiges" hidden="{{guigesHidden}}">
<view class="selguige_box" wx:for="{{selguiges}}">
<view class="selguige_item {{(item.selectednum>0?'hover':'')}}" data-id="{{index}}">
<view class="select_name">{{item.gg}}<view>兑换券:{{(ttype==6 && addtype==0)?item.jg2:item.jg}}</view><!--<view>金豆:{{item.jg0}}</view>--></view>
<view class="select_colors" wx:if='{{item.colors!=""}}' bindtap="showcolor" data-id="{{index}}">
<view>{{item.selectedcolor==""?"选择颜色":item.selectedcolor}}</view>
</view>
<view class="select_box_selnum">
<view class="select_box_selnum_box">
<view class="num">数量</view>
<view class="addcart_input">
<text class="num_del" bindtap="decrement" data-id="{{index}}"></text>
<input name="product_amount" id="product_amount" type="text" class="input_text" bindinput="inputOnlyNum" value="{{item.selectednum}}" data-id="{{index}}" disabled='' />
<text class="num_add" bindtap="increment" data-id="{{index}}"></text>
</view>
</view>
<view class="productkc">库存:{{item.kc}}</view>
</view>
</view>
</view>
</view>
<view class="select_box_btn">
<button bindtap="qyaddcart" value="{{qyaddcart}}" >{{qyaddcart}}</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{colorHidden}}" bindtap="closecolor">
<view class="Hidden_box_to" catchtap="incolor">
<view class="title">点击下面颜色</view>
<view class="close" bindtap="closecolor"><image src="../../images/close.png" /></view>
<view class="body">
<view class="select_box_selcolor" wx:for="{{selguiges[currentindex].colors}}">
<view bindtap="selcolor" class="selguige_item {{selguiges[currentindex].selectedcolor==item.color?'selected':''}}" data-id="{{index}}"><text></text><view class="guigetit">{{item.color}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="cartmsg" hidden="{{cartmsgHidden}}">
<view class="cartmsg_title">商品已经成功加入</view>
<view class="gotocart" bindtap="gotocart">去付款</view>
<view class="em"></view><view class="icon" bindtap="closemsg"><image src="../../images/close.png" /></view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden0}}" bindtap="closeauth0">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">绑定手机号码</view>
<view class="close" bindtap="closeauth0"><image src="../../images/close.png" /></view>
<view class="body">
<view>为了给您提供更好的服务,需要绑定您的手机号码</view>
<view class="frombody" wx:if="{{!bindPhoneHidden}}">
<form bindsubmit='bindPhone'>
<view class="sendbutton">
<text>手机号码:</text><input name="phone" type="text" bindinput="inputphone" placeholder="填写手机号" value="{{phone}}" /><button id="getPhoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">{{onauthorizetitle0}}</button>
</view>
<view class="sendbutton">
<text>手机验证码:</text><input name="code" class="code" type="text" placeholder="填写验证码" value="" /> <button bindtap="getcode0">{{getcode0}}</button>
</view>
<view class="button">
<!--<button class="qx" bindtap="closeauth0">暂时不绑定</button>--><button form-type="submit">{{savebutton0}}</button>
</view>
</form>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{ptgzHidden}}" bindtap="closeptgz">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">{{ptgztitle}}</view>
<view class="close" bindtap="closeptgz"><image src="../../images/close.png" /></view>
<view class="body">
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:ptgzbody.nodes}}"/>
</view>
<view class="check_box">
<view class='checkbox {{checked==1?"checked":""}}' bindtap="onchecked"></view><view class="fontbox"><text bindtap="onchecked">我已阅读并同意</text><text bindtap="openptgz" class="ptgztitle">《{{ptgztitle0}}》</text></view>
</view>
<view class="button">
<button bindtap="yydptgz">{{ptgzbutton}}</button>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{ptgzHidden0}}" bindtap="closeptgz0">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">{{ptgztitle0}}</view>
<view class="close" bindtap="closeptgz0"><image src="../../images/close.png" /></view>
<view class="body">
<view class="frmbody">
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:ptgzbody0.nodes}}"/>
</view>
</view>
<view class="button">
<button bindtap="yydptgz0">{{ptgzbutton0}}</button>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,203 @@
var app=getApp()
var that=null
var sopenFrame=null
var wait=120
var username=""
var phone=""
Page( {
data: {
getcode:"获取验证码",
savebutton:"重置密码"
},
onLoad: function() {
that = this
that.rdata()
},rdata: function() {
},login:function(e) {
var username = "";//e.detail.value.username
var phone = e.detail.value.phone
var code = e.detail.value.code
var psd=e.detail.value.psd
var psd2=e.detail.value.psd2
var b=true
/*if(username==null || username==""){
b=false
wx.showToast({
title: "用户名不能为空!",
icon: "none",
duration: 3000
})
}*/
if(b){
if(phone==null || phone==""){
b=false
wx.showToast({
title: "手机号码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(code==null || code==""){
b=false
wx.showToast({
title: "手机验证码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(psd==null || psd==""){
b=false
wx.showToast({
title: "新密码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
var patrn =/^(?=.{6,16}$)[0-9a-zA-Z_]+$/;
if(!patrn.exec(psd)) {
b=false
wx.showToast({
title: "新密码由6-16位数字、字母、下划线组成",
icon: "none",
duration: 3000
})
}
}
if(b){
if(psd2==null || psd2==""){
b=false
wx.showToast({
title: "确认密码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(psd!=psd2){
b=false
wx.showToast({
title: "两次输入新密码不一致!",
icon: "none",
duration: 3000
})
}
}
if(b){
that.setData({
savebutton:"请稍候..."
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"forgetPassword",
//username:username,
phone:phone,
code:code,
password:psd
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
that.setData({
savebutton:"保存"
})
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},getcode:function(e) {
var b=true
if(b){
if(phone==null || phone==""){
b=false
wx.showToast({
title: "手机号码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"sendphonecode0",
username:phone,
phone:phone
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.gettime()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},
gettime:function() {
if (wait == 0) {
that.setData({
getcode:"获取验证码"
})
wait = 120;
} else {
that.setData({
getcode: "重新发送(" + wait + ")"
})
wait--;
setTimeout(function() {
that.gettime()
}, 1000)
}
},getusernameValue:function(e) {
username=e.detail.value
},getphoneValue:function(e) {
phone=e.detail.value
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "忘记密码"
}

View File

@@ -0,0 +1,31 @@
<view class="container">
<view class="login-box">
<view class="frombody">
<form bindsubmit='login'>
<!--<view>
<text>用户名:</text><input name="username" bindinput='getusernameValue' type="text" placeholder="请填写用户名" value="" />
</view>-->
<view>
<text>手机号码:</text><input name="phone" bindinput='getphoneValue' type="text" placeholder="请填写手机号码" value="" />
</view>
<view>
<text>手机验证码:</text><input name="code" type="text" placeholder="请填写手机验证码" value="" class="code" /><view class="getcode" bindtap="getcode">{{getcode}}</view>
</view>
<view>
<text>新密码:</text><input name="psd" type="password" placeholder="请填写登录密码" value="" />
</view>
<view>
<text>确认新密码:</text><input name="psd2" type="password" placeholder="请填写登录密码" value="" />
</view>
<view class="button">
<button form-type="submit">{{savebutton}}</button>
</view>
</form>
</view>
</view>
</view>

View File

@@ -0,0 +1,27 @@
/**index.wxss**/
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
background-size: 100% 100%
}
.clear{clear: both;height: 0;width:100%;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.login-box .frombody{margin-top: 1em; padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.login-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.login-box .frombody view view{width:auto;border-bottom:0;}
.login-box .frombody view text{padding:0; width:6em; height:2.5em; line-height: 2.5em;}
.login-box .frombody view input{width:12em;height:2.5em; line-height: 2.5em;}
.login-box .frombody view input.code{width:9em;}
.login-box .frombody view.area input{width:12.8em;}
.login-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.login-box .frombody view.button{border: 0;}
.login-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}

2289
pages/index/index.js Normal file

File diff suppressed because it is too large Load Diff

3
pages/index/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "银花优选"
}

315
pages/index/index.wxml Normal file
View File

@@ -0,0 +1,315 @@
<!--index.wxml-->
<import src="../../wxParse/wxParse.wxml" />
<view class="container">
<view class="container-header">
<view class="header">
<!--<view class="searchbox2">
<view class="logobox"><image src="../../images/logo2.png" /></view>
</view>-->
<view class="searchbox">
<view class="icobox" bindtap="onsearch">
<image src="../../images/searchto1.png" />
</view>
<view class="inpubox">
<input type="text" placeholder="{{qkeyword}}" confirm-type="search" focus="{{getfocus}}"
bindinput="getkeyword" bindconfirm="onsearch" placeholder-style="color:#bbb;" />
</view>
<view class="searchicobox" bindtap="onsearch">搜索</view>
<view class="icobox0" bindtap="onCategory" data-id="购物车">
<image src="../../images/cart0.png" />
</view>
<!---->
</view>
</view>
<view wx:if="{{currentTab==0}}" class="container0">
<view class="swiper">
<swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{images}}" wx:key="index">
<swiper-item bindtap="onslide" data-id="{{item.url}}">
<image src="{{item.img}}" class="slide-image" />
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
<view class="notice_box">
<view class="notice_title">
<image src="../../images/notice_ico0.png"></image><text>最新公告</text>
</view>
<view class="notice_body">
<swiper class="swiper_box0" indicator-dots="{{indicatorDots0}}" vertical="{{vertical0}}" circular="true"
autoplay="{{autoplay}}" interval="{{interval0}}" duration="{{duration0}}" display-multiple-items="1"
style="height: 70rpx; display: block; box-sizing: border-box">
<swiper-item wx:for="{{news}}" wx:key="index" bindtap="onnotice" data-id="{{item.id}}">
<image src="../../images/news-ico.png"></image>{{item.title}}
</swiper-item>
</swiper>
</view>
</view>
<view class="mydata_box0" wx:if="{{IFCS==1}}">
<view class="mydata_box0_bo">
<view>
<view wx:if='{{icon1===0}}' bindtap="onCategory" data-id="企业介绍">
<image src='../../images/mydata0_ico0.png'></image>
<text>企业介绍</text>
</view>
<!--
<view bindtap="onCategory" data-id="会客厅">
<image src='../../images/mydata0_ico1.png'></image>
<text>会客厅</text>
</view>
-->
<view wx:if='{{icon2===0}}' bindtap="onCategory" data-id="操作教程">
<image src='../../images/mydata0_ico4.png'></image>
<text>操作教程</text>
</view>
<view wx:if='{{icon3===0}}' bindtap="onCategory" data-id="发图素材">
<image src='../../images/mydata0_ico2.png'></image>
<text>发图素材</text>
</view>
<view wx:if='{{icon4===0}}' bindtap="onCategory" data-id="健康知识">
<image src='../../images/mydata0_ico5.png'></image>
<text>健康知识</text>
</view>
<view wx:if='{{icon5===0}}' bindtap="onCategory" data-id="客服专区">
<image src='../../images/mydata0_ico3.png'></image>
<text>客服专区</text>
</view>
</view>
<view class="boview">
<!--
<view bindtap="onCategory" data-id="助农专区">
<image src='../../images/mydata0_ico5.png'></image>
<text>助农专区</text>
</view>
<view bindtap="onCategory" data-id="品牌展示">
<image src='../../images/mydata0_ico6.png'></image>
<text>品牌展示</text>
</view>
<view bindtap="onCategory" data-id="体验区">
<image src='../../images/mydata0_ico7.png'></image>
<text>体验区</text>
</view>
-->
</view>
</view>
</view>
<view class="menudata_box">
</view>
<view class="container_box">
<view class="container_box_to">
<view class="choice_text">
<view class="line_flag"></view>
<text>热卖推荐</text>
</view>
<view class="choice_box">
<view class="choice_list">
<block wx:for="{{products}}" wx:for-item="cell" wx:for-index="index0">
<view class='block' bindtap="gotodetail" data-id="{{cell._id}}">
<view class='choice_item'>
<view class='choice_item_image'>
<image src="{{cell.image}}" />
</view>
<view class='choice_item_font'>
<view class="title">{{cell.name}}</view>
<view class="price">零售价:¥{{cell.scje}}</view>
<view class="price">会员价:¥{{cell.hyje}}</view>
<view class="right_button">
<view>立即购买</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<view class="container_box_to" style="margin-bottom: 6em;">
<view class="choice_text">
<view class="line_flag"></view>
<text>兑换商城</text>
</view>
<!-- tab导航栏 -->
<!--<scroll-view scroll-x="true" class="tab-h" scroll-left="{{scrollLeft}}">
<view wx:for="{{navData}}" class="tab-item {{currentTab == index ? 'tab-active' : ''}}" data-current="{{index}}" bindtap="switchTab">{{item.label}}</view>
</scroll-view>-->
<view class="choice_box">
<view class="choice_list">
<block wx:for="{{products0}}" wx:for-item="cell" wx:for-index="index0">
<view class='block' bindtap="gotoPointDetail" data-id="{{cell._id}}">
<view class='choice_item'>
<view class='choice_item_image'>
<image src="{{cell.image}}" />
</view>
<view class='choice_item_font'>
<view class="title">{{cell.name}}</view>
<view class="price" style="display:none;">零售价:¥{{cell.scje}}</view>
<view class="price">兑换券:{{cell.hyje}}</view>
<view class="right_button">
<view>立即购买</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{addcartHidden}}" bindtap="closeaddcart">
<view class="Hidden_box_to addcart_box" catchtap="inaddcart">
<view class="close" bindtap="closeaddcart">
<image src="../../images/close.png" />
</view>
<view class="select_box_pic" bindtap="viewimages">
<image src="{{showimage}}"></image>
</view>
<view class="select_box_title">
<!--<view class="price"><text id="minprice">¥{{minprice}}</text></view>-->
<view class="selguige">
<text class="selguige_font">{{selguige_font}}</text>
<text class="selguige_title">{{selguige_title}}</text>
</view>
</view>
<view class="select_box_selguige" id="guiges" hidden="{{guigesHidden}}">
<view class="selguige_box" wx:for="{{selguiges}}">
<view class="selguige_item {{(item.selectednum>0?'hover':'')}}" data-id="{{index}}">
<view class="select_name">{{item.gg}}
<view>¥{{item.jg}}</view>
</view>
<view class="select_colors" wx:if='{{item.colors!=""}}' bindtap="showcolor" data-id="{{index}}">
<view>{{item.selectedcolor==""?"选择颜色":item.selectedcolor}}</view>
</view>
<view class="select_box_selnum">
<view class="select_box_selnum_box">
<view class="num">数量</view>
<view class="addcart_input">
<text class="num_del" bindtap="decrement" data-id="{{index}}"></text>
<input name="product_amount" id="product_amount" type="text" class="input_text" bindinput="inputOnlyNum"
value="{{item.selectednum}}" data-id="{{index}}" />
<text class="num_add" bindtap="increment" data-id="{{index}}"></text>
</view>
</view>
<view class="productkc">库存:{{item.kc}}</view>
</view>
</view>
</view>
</view>
<view class="select_box_btn">
<button bindtap="qyaddcart" value="{{qyaddcart}}">{{qyaddcart}}</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{colorHidden}}" bindtap="closecolor">
<view class="Hidden_box_to" catchtap="incolor">
<view class="title">点击下面颜色</view>
<view class="close" bindtap="closecolor">
<image src="../../images/close.png" />
</view>
<view class="body">
<view class="select_box_selcolor" wx:for="{{selguiges[currentindex].colors}}">
<view bindtap="selcolor"
class="selguige_item {{selguiges[currentindex].selectedcolor==item.color?'selected':''}}" data-id="{{index}}">
<text></text>
<view class="guigetit">{{item.color}}</view>
</view>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>
<view class="Hidden_box" hidden="{{authorizeHidden}}" bindtap="closeauth">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">微信授权</view>
<view class="close" bindtap="closeauth">
<image src="../../images/close.png" />
</view>
<view class="body">
<view>为了给您提供更好的服务,需要获取您的微信头像和昵称</view>
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile">{{onauthorizetitle}}</button>
<button wx:else id="getUserInfo" open-type="getUserInfo"
bindgetuserinfo="onauthorize">{{onauthorizetitle}}</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden0}}">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">绑定手机号码</view>
<view class="close" bindtap="closeauth0">
<image src="../../images/close.png" />
</view>
<view class="body">
<view>为了给您提供更好的服务,需要绑定您的手机号码</view>
<view class="frombody" wx:if="{{!bindPhoneHidden}}">
<form bindsubmit='bindPhone'>
<view>
<text>手机号码:</text><input name="phone" type="text" bindinput="inputphone" placeholder="填写手机号"
value="{{phone}}" /><button id="getPhoneNumber" open-type="getPhoneNumber"
bindgetphonenumber="getPhoneNumber">{{onauthorizetitle0}}</button>
</view>
<view>
<text>手机验证码:</text><input name="code" class="code" type="text" placeholder="填写验证码" value="" /> <button
bindtap="getcode0">{{getcode0}}</button>
</view>
<view class="button">
<button class="qx" bindtap="closeauth0">取消</button><button form-type="submit">{{savebutton0}}</button>
</view>
</form>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{closenoticeHidden}}" bindtap="closeauth">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">{{showtitle}}</view>
<view class="close" bindtap="closeauth">
<image src="../../images/close.png" />
</view>
<view class="body">
<view class="wxParse">
<template is="wxParse" data="{{wxParseData:body.nodes}}" />
</view>
<button bindtap="closenotice">知道了,关闭</button>
</view>
</view>
</view>
<block wx:for="{{myAudios}}">
<audio id="myAudio" src="audioUrl" autoplay="false" loop=""></audio>
</block>

970
pages/index/index.wxss Normal file

File diff suppressed because one or more lines are too long

219
pages/kttgy/index.js Normal file
View File

@@ -0,0 +1,219 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
loadingHidden:false,
t:0,
mybalance:[],
Start: 0,
savebutton:"",
qybutton:"确定",
isShowConfirm:false,
username:"",
pwd:""
},
onLoad: function(options) {
that = this
if(options.t){
that.setData({
t:options.t
});
}
var title="开通推广员"
if(that.data.t==1){
title="激活商家"
}
wx.setNavigationBarTitle({
title: title
})
that.setData({
savebutton:title
});
that.rdata()
that.clearCache();//清本页缓存
that.getlist(0);
},rdata: function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
loadingHidden:false,
Start: 0,
mybalance:[]
});
},getlist: function(gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getkttgylist",
t:that.data.t,
Start:that.data.Start,
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
tmpArr = that.data.mybalance;
if(res.data.data.length>0){
tmpArr.push.apply(tmpArr,res.data.data);
}
that.setData({
mybalance: tmpArr,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
}
,onsubmit:function(e) {
var username=e.detail.value.username.replace(/\s+/g, "");
var b=true
if(b){
if(username==""){
b=false
wx.showToast({
title: "会员账号不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
that.setData({
username:username,
isShowConfirm:true
})
}
},cancelsubmit:function() {
that.setData({
isShowConfirm:false
})
},
//输入框中的值
setValue: function (e) {
this.setData({
pwd: e.detail.value
})
},
onsmlog: function (e) {
var id=e.currentTarget.dataset.id;
wx.navigateTo({
url: "../mybusiness_smlog/index?t0=" + (that.data.t==1?1:2) + "&MemberId=" + id
})
},confirmsubmit:function(e) {
var username=that.data.username.replace(/\s+/g, "");
var pwd =that.data.pwd.replace(/\s+/g, "");
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var b=true
if(b){
if(pwd==""){
b=false
wx.showToast({
title: "安全密码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
that.setData({
qybutton:"请稍候..."
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"kttgy",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
t:that.data.t,
username:username,
pwd:pwd
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
app.globalData.IFRefreshmy=1
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.clearCache();//清本页缓存
that.getlist(0);
that.cancelsubmit();
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
that.setData({
qybutton:"确定"
})
}
})
}
}
})

3
pages/kttgy/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": ""
}

69
pages/kttgy/index.wxml Normal file
View File

@@ -0,0 +1,69 @@
<view class="container">
<view class="mydata-box">
<view class="frombody">
<form bindsubmit='onsubmit'>
<view>
<input name="username" type="text" placeholder="请填写会员账号" />
</view>
<view class="button">
<button form-type="submit">{{savebutton}}</button>
</view>
</form>
</view>
</view>
<view class="mybalance-box">
<view class="text">
<view class="line_flag"></view>
<text>{{t==1?"激活":"开通"}}记录</text>
</view>
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index">
<view class="Total">
<view><text>账号:</text>{{item.UserName}}</view>
<view class="right">{{item.sjname}}</view>
</view>
<view class="Total0">
<view class="alink" bindtap="onsmlog" data-id="{{item.UserId}}"><text>扫码总额:</text>{{item.smzemoney}}</view>
<view class="right"><text>今日金额:</text>{{item.jrmoney}}</view>
</view>
<view class="Total0">
<view><text>昨日金额:</text>{{item.zrmoney}}</view>
<view class="right"><text style="color:#848484">{{item.addtime}}</text></view>
</view>
<view>
</view>
</view>
</view>
</view>
<view class='toast-box' wx:if="{{isShowConfirm}}">
<view class='toastbg'></view>
<view class='showToast'>
<view class='toast-main'>
<view class='toast-input'>
<input type='password' bindinput='setValue' placeholder="请填写安全密码"></input>
</view>
</view>
<view class='toast-button'>
<view class='button1'>
<view catchtap='cancelsubmit'>取消</view>
</view>
<view class='button2'>
<view catchtap='confirmsubmit'>{{qybutton}}</view>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

137
pages/kttgy/index.wxss Normal file
View File

@@ -0,0 +1,137 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.mydata-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;}
.mydata-box .frombody{ padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.mydata-box .frombody view{position: relative; width:100%;display: flex;flex-direction:row;padding:0.5em 0; box-sizing: border-box; text-align: center; }
.mydata-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.mydata-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em; background-color:#f5f5f5;border:1px solid #dfdfdf;border-radius:0.5em;padding: 0 0.2em;text-align:left; }
.mydata-box .frombody view.area input{width:12.8em;}
.mydata-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.mydata-box .frombody view.button{border: 0;}
.mydata-box .frombody view.button button{width:7em;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;font-size: 1em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.text{
margin-bottom: 0.8em;
height: 2.5em;
line-height: 2.5em;
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
border-bottom:1px solid #f1f1f1;
}
.text .line_flag{
margin-top: 0em;
margin-left: 0.8em;
margin-right: 0.5em;
width:0.5em;
height: 1.5em;
line-height: 1.5em;
background-color: #00B050;
border-radius:0.2em;
}
.text .line_more{
flex: 1;
text-align: right;
align-self: center;
color:#ff0000
}
.mybalance-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%; padding:0 0.8em; box-sizing: border-box;}
.mybalance-item{width:100%;display: flex;flex-direction: column; align-items: center;justify-content: center;box-sizing: border-box; padding:0.8em; margin:0.8em 0; margin-top: 0; line-height: 2em; background-color:#fff;border-radius:0.5em;}
.mybalance-item view{width:100%;display: flex;flex-direction: row; align-items: center;justify-content:left;color: #848484;}
.mybalance-item view text{color: #000;}
.mybalance-item view text.Totalprice{ margin-left: 1em;}
.mybalance-item view.Total{float: left; display: block;}
.mybalance-item view.Total view{float: left; display: block;width:auto; margin:0; padding:0; box-sizing: border-box; overflow: hidden;}
.mybalance-item view.Total view.right{float:right;color:#848484}
.mybalance-item view.Total view text{float: left; display: block;width:auto;color: #000;}
.mybalance-item view.Total0{float: left; display: block;color:#ff4d00;}
.mybalance-item view.Total0 view{float: left; display: block;width:auto; margin:0; padding:0;color:#ff4d00; box-sizing: border-box; overflow: hidden;}
.mybalance-item view.Total0 view.right{float:right;width:auto;color:#ff4d00;}
.mybalance-item view.Total0 view.right text{color:#000;}
.mybalance-item view.Total0 view.alink{color:#00B050;}
.mybalance-item view.Total0 view.alink text{color:#00B050;}
/* 弹出窗 */
.toast-box {
width: 100%;
height: 100%;
opacity: 1;
position: fixed;
top: 0px;
left: 0px;
}
.toastbg {
opacity: 0.5;
background-color: black;
position: absolute;
width: 100%;
min-height: 100vh;
}
.showToast {
position: absolute;
opacity: 1;
width: 80%;
margin-left: 10%;
margin-top: 70%;
}
.toast-main {
padding-top: 2vh;
padding-bottom: 2vh;
background-color: white;
text-align: center;
border-top-left-radius: 16rpx;
border-top-right-radius: 16rpx;
}
.toast-input {
margin-left: 5%;
margin-right: 5%;
margin-top:10%;
margin-bottom:10%;
background-color: rgb(240, 240, 240);
padding-left: 2vh;
padding-right: 2vh;
padding-top: 1vh;
padding-bottom: 1vh;
border-radius:0.5em;
}
.toast-input input{
background-color: rgb(240, 240, 240);
}
.toast-button {
display: flex;
background-color: white;
height:50px;
width:100%;
border-radius: 0px;
border-bottom-left-radius: 16rpx;
border-bottom-right-radius: 16rpx;
border-top:1px solid rgb(211, 211, 211);
}
.button1 {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0px;
border-bottom-left-radius: 16rpx;
}
.button2 {
width: 50%;
border-left:1px solid rgb(211, 211, 211);
display: flex;
align-items: center;
justify-content: center;
color:#40A4D6;
}

133
pages/list/index.js Normal file
View File

@@ -0,0 +1,133 @@
var app = getApp()
var that = null
Page({
data: {
products: [],
categoryid: 0,
keyword:"",
Recount:0,
Start: 0,
t:0,
onsearchHidden:true,
loadingHidden:false,
nodataHidden:true
},
onLoad: function(options) {
that = this
that.clearCache();//清本页缓存
if(options.id&&options.title){
that.setData({
categoryid:options.id
})
wx.setNavigationBarTitle({
title: options.title
})
}
if(options.t){
that.setData({
t:options.t
})
}
if(options.keyword){
that.setData({
keyword:options.keyword,
onsearchHidden:false
})
wx.setNavigationBarTitle({
title: "搜索商品"
})
}
that.getlist(0);//第一次加载数据
},
// 下拉刷新
onPullDownRefresh: function () {
that.clearCache();
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
products: [],
Start: 0,
loadingHidden:false
});
}, getlist: function (gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getwxshoplist",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
categoryid:that.data.categoryid,
keyword:that.data.keyword,
Start:that.data.Start
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
var tmpArr = null;
tmpArr = that.data.products;
tmpArr.push.apply(tmpArr,res.data.productlist);
that.setData({
products: tmpArr,
Start: that.data.Start+res.data.productlist.length,
Recount:res.data.Recount,
loadingHidden:true
})
if(gp==0||gp==1){
if(res.data.productlist.length==0){
that.setData({
nodataHidden:false
})
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},gotodetail:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../details/index?id="+id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
}
})

3
pages/list/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "分类列表"
}

37
pages/list/index.wxml Normal file
View File

@@ -0,0 +1,37 @@
<view class="container">
<view class="searchdata" hidden="{{onsearchHidden}}">共找到 “{{keyword}}” 相关的产品 {{Recount}} 条</view>
<view>
<view class="choice_box">
<view class="choice_list">
<block wx:for="{{products}}" wx:for-item="cell" wx:for-index="index0">
<view class='block block0{{(index0%2)==1?" r":" l"}}' bindtap="gotodetail" data-id="{{cell._id}}">
<view class='choice_item'>
<image src="{{cell.image}}"/>
<view class="title">{{cell.name}}</view>
<view class="je">
<view class="jeto">
<view>零售价: </view>
<view class="scje">¥{{cell.scje}}</view>
</view>
<view class="jeto">
<view>会员价:</view>
<view class="hyje">{{cell.hyje}}</view>
</view>
<view class="jeto">
<view>可用补贴券:</view>
<view class="hyje">{{cell.hyjf}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<view class="nodata" hidden="{{nodataHidden}}">{{keyword==""?"暂无此类商品":""}}</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

122
pages/list/index.wxss Normal file
View File

@@ -0,0 +1,122 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.container .nodata{
width: 100%;
height: 100%;
text-align: center;
line-height: 5em;
}
.container .searchdata{
width: 100%;
height: 100%;
text-align: center;
line-height: 5em;
color: #939393;
}
.choice_box {
float: left;
width:100%;
padding:0;
padding-top: 0.5em;
box-sizing: border-box;
}
.choice_box .choice_list .block{
float: left;
width: 100%;
padding:0.5em;
box-sizing: border-box;
}
.choice_box .choice_list .block.block0{
width: 50%;
padding: 0.5em;
padding-top: 0;
text-align: center;
overflow: hidden;
}
.choice_box .choice_list .block.block0.l{
padding-right: 0.25em;
}
.choice_box .choice_list .block.block0.r{
padding-left: 0.25em;
}
.choice_box .choice_list .block .choice_item{
float: left;
width: 100%;
padding:0;
border:1px solid #f1f1f1;
background-color: #f5f5f5;
border-radius:0.5em;
box-sizing: border-box;
overflow: hidden;
}
.choice_box .choice_list .block image {
width: 100%;
height:90vw;
}
.choice_box .choice_list .block.block0 image {
width: 100%;
height:46vw;
}
.choice_box .choice_list .title {
float: left;
padding:0 0.5em;
font-weight: bold;
text-align: left;
display: block;
box-sizing: border-box;
overflow: hidden;
}
.choice_box .choice_list .je {
float: right;
width:auto;
display: flex;
flex-direction:column;
align-items:flex-end;
font-size: 12px;
font-weight: bold;
color: #939393;
padding:0 0.5em;
padding-bottom: 0.5em;
box-sizing: border-box;
}
.choice_box .choice_list .je .jeto{
display: flex;
flex-direction:row;
margin-top: 0.8em;
background-color: #00B050;
padding: 0.4em 0.4em;
color:#fff;
border-radius:0.5em;
box-sizing: border-box;
}
.choice_box .choice_list .je .jeto .scje{
text-decoration:line-through;
}
.choice_box .choice_list .block.block0 .title{
width:100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.choice_box .choice_list .block.block0 .je {
float: left;
width:100%;
display: block;
text-align: center;
}
.choice_box .choice_list .block.block0 .je .jeto .hyje{
margin-top: 0.15em;
}

247
pages/login/index.js Normal file
View File

@@ -0,0 +1,247 @@
var app = getApp()
var that=null
var sopenFrame0=null
var wait=120
var updateing=0;
Page( {
data: {
IFDefault:0,
username:"",
phone:"",
getcode0:"获取验证码",
psd:"",
tguid:0,
nav:1,
loginbutton:"会员登录",
loginbutton2:"微信一键登录"
},
onLoad: function() {
that = this
that.rdata()
var tguid = wx.getStorageSync('tguid');
if(tguid){
that.setData({
tguid:tguid
})
}
},onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.rdata()
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
},rdata: function() {
var LoginData = wx.getStorageSync("LoginData")
if(LoginData){
var lData = LoginData.split('|')
that.setData({
IFDefault:1,
username:lData[0],
psd:lData[1]
})
}
},getphoneValue:function(e) {
that.setData({
phone:e.detail.value.replace(/\s+/g, "")
})
},getcode0:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var b=true
if(b){
if(updateing==0){
updateing=1
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"sendphonecode0",
username:that.data.phone,
phone:that.data.phone
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
updateing=0
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.gettime0()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
}
},
gettime0:function() {
if (wait == 0) {
that.setData({
getcode0:"获取验证码"
})
wait = 120;
updateing=0
} else {
that.setData({
getcode0: "重新发送(" + wait + ")"
})
wait--;
setTimeout(function() {
that.gettime0()
}, 1000)
}
},login:function(e) {
var username = ""
var password= ""
if(that.data.nav==0){
username = e.detail.value.txtphone.replace(/\s+/g, "");
password=e.detail.value.txtcode.replace(/\s+/g, "");
}else{
username = e.detail.value.txtusername.replace(/\s+/g, "");
password=e.detail.value.txtpsd.replace(/\s+/g, "");
}
var IFDefault=that.data.IFDefault
var b=true
if(username==""){
b=false
wx.showToast({
title: "手机号码不能为空!",
icon: "none",
duration: 3000
})
}
if(b){
if(password==""){
b=false
wx.showToast({
title: (that.data.nav==0?"手机验证码":"登录密码") + "不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
wx.login({
success: function (resc) {
if (resc.code) {
var code=resc.code;
that.setData({
loginbutton:"请稍候..."
})
var tguid = wx.getStorageSync("tguid")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"login",
username:username,
password:password,
t:that.data.nav,
code:code,
tguid:(!tguid?"":tguid),
IFDefault:IFDefault
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 2000
})
wx.setStorageSync('userId', res.data.userId)
wx.setStorageSync('LoginId', res.data.LoginId)
//wx.setStorageSync('latitude', res.data.latitude)
//wx.setStorageSync('longitude', res.data.longitude)
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
wx.setStorageSync("openid", res.data.userInfo.openid);
wx.setStorageSync('IFLogin', 1)
wx.removeStorageSync('IFYYD')
app.globalData.IFRefreshmy=1
app.globalData.IFRefreshshangquan=1
app.globalData.IFRefreshindex=1
app.globalData.IFRefreshshop=1
if(that.data.IFDefault==1){
wx.setStorageSync('LoginData', username+"|"+password)
}else{
wx.removeStorageSync('LoginData')
}
sopenFrame0=setInterval(function (){
clearInterval(sopenFrame0);
wx.navigateBack({})
}, 500)
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
that.setData({
loginbutton:"会员登录"
})
}
}
})
}
}
})
}
},weixinlogin:function(e) {
that.setData({
loginbutton2:"请稍候..."
})
app.globalData.IFwxLogin=1
app.getUserInfo()
},wjmm:function(e) {
wx.navigateTo({
url: "../forgetPassword/index"
})
},register:function(e) {
wx.navigateTo({
url: "../register/index"
})
},changeisDefault:function(e) {
var ifdefault = (e.detail.value==true?1:0)
that.data.IFDefault=ifdefault
},onnav:function(e) {
var index = e.currentTarget.dataset.id
that.setData({
nav:index
})
}
})

3
pages/login/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "会员登录"
}

65
pages/login/index.wxml Normal file
View File

@@ -0,0 +1,65 @@
<view class="container">
<!-- <view class="myorder-menu">
<view class='{{nav==1?"hover":""}}' bindtap="onnav" data-id="1">账号密码登录</view>
<view class='{{nav==0?"hover":""}}' bindtap="onnav" data-id="0">手机验证码登录</view>
</view> -->
<view class="login-box" wx:if="{{nav==0}}">
<view class="frombody">
<form bindsubmit='login'>
<view class="phone">
<text>手机号码:</text><input name="txtphone" type="text" bindinput='getphoneValue' placeholder="请填写手机号码" value="{{phone}}" />
</view>
<view class="code">
<text>手机验证码:</text><input name="txtcode" type="password" placeholder="请填写手机验证码" value="" /> <button bindtap="getcode0">{{getcode0}}</button>
</view>
<view class="button">
<button form-type="submit">{{loginbutton}}</button>
</view>
</form>
<!--
<view class="weixinbutton">
<button bindtap="weixinlogin">{{loginbutton2}}</button>
</view>-->
</view>
</view>
<view class="login-box" wx:if="{{nav==1}}">
<view class="frombody">
<form bindsubmit='login'>
<view>
<text>手机号码:</text><input name="txtusername" type="text" placeholder="请填写手机号码" value="{{username}}" />
</view>
<view>
<text>登录密码:</text><input name="txtpsd" type="password" placeholder="请填写登录密码" value="{{psd}}" />
</view>
<view class="button">
<button form-type="submit">{{loginbutton}}</button>
</view>
</form>
<view class="loginbottom">
<view>
<text>记住账号和密码:</text>
<switch checked='{{IFDefault}}' color="#00B050" bindchange="changeisDefault"></switch>
</view>
</view>
<view class="wjmm">
<view bindtap="wjmm">忘记密码?</view> <view class="zchy" bindtap="register">注册新会员</view>
</view>
<!-- <view class="weixinbutton">
<button bindtap="weixinlogin">{{loginbutton2}}</button>
</view>-->
</view>
</view>
</view>

40
pages/login/index.wxss Normal file
View File

@@ -0,0 +1,40 @@
/**index.wxss**/
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
background-size: 100% 100%
}
.myorder-menu{display: flex;flex-direction: row;align-items: center;justify-content: center;width:100%; background-color: #fff;}
.myorder-menu view{display: flex;flex: 1; height:2.5em; line-height: 2.5em; text-align: center; border-left:0;border-top: 0; align-items: center;justify-content: center;
background:linear-gradient(to bottom,#dedede,#eee);
}
.myorder-menu view.hover{background:linear-gradient(to bottom,#ff4d00,#ff4d00);color:#fff;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.login-box .frombody{ padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.login-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.login-box .frombody view text{padding:0; width:6em; text-align: left; height:2.5em; line-height: 2.5em;}
.login-box .frombody view.loginbottom view {float:left; display:block; width:100%;padding: 0;border-bottom:0;}
.login-box .frombody view.loginbottom view text{float:left; display:block;width:10em;}
.login-box .frombody view.loginbottom view switch{float:left; display:block;width:5em;}
.login-box .frombody view.wjmm{float:left; display:block;width:100%; text-align: center;border-bottom:0;}
.login-box .frombody view.wjmm view{float:left; display:block;width:50%; text-align: center;border-bottom:0;}
.login-box .frombody view.wjmm view.zchy{color:#00B050; font-weight: 900;}
.login-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.login-box .frombody view.area input{width:12.8em;}
.login-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.login-box .frombody view.phone input{width:12em;}
.login-box .frombody view.code input{width:8em;}
.login-box .frombody view.code button{width:6em; margin-top: 0.5em; padding:0; height:2em; line-height: 2em; font-size:0.85em; background:#ff4d00; color:#fff; border-radius:0.5em;}
.login-box .frombody view.button{border: 0;}
.login-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
.login-box .frombody view.weixinbutton{border: 0;position: fixed; bottom:0; left:0;padding: 1em; box-sizing: border-box;}
.login-box .frombody view.weixinbutton button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to left,#1e990a,#87ae10); color:#fff; border-radius:0.5em;}

54
pages/map/index.js Normal file
View File

@@ -0,0 +1,54 @@
var app = getApp()
var that=null
var sopenFrame=null
var areas = null;
Page( {
data: {
loadingHidden:false,
latitude:0,
longitude:0,
address:"",
scale:15,
markers: []
},
onReady: function(e) {
// 使用 wx.createMapContext 获取 map 上下文
this.mapCtx = wx.createMapContext('myMap');
},
onLoad: function(options) {
that = this
if(options.lat&&options.lon){
that.setData({
latitude:options.lat,
longitude:options.lon,
address:options.address,
loadingHidden:true,
markers: [{
id:8900,
latitude: options.lat,
longitude: options.lon,
iconPath: '../../images/position-picker2.png',
width: 80,
height: 80,
callout: {
content: options.address,
display: 'ALWAYS',
color: '#000',
bgColor: '#fff',
padding: 5,
borderRadius: 10,
borderColor: '#f1f1f1',
fontSize: 14,
borderWidth: 1,
textAlign: 'center',
}
}]
});
}
that.rdata()
},rdata: function() {
}
})

3
pages/map/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "显示地图"
}

13
pages/map/index.wxml Normal file
View File

@@ -0,0 +1,13 @@
<view class="container">
<map id="myMap" latitude="{{latitude}}" longitude="{{longitude}}" scale="{{scale}}" style="width: 100%; height: 100vh;" show-location="{{true}}" markers="{{markers}}">
</map>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

72
pages/map/index.wxss Normal file
View File

@@ -0,0 +1,72 @@
page{
background: #ccc;
}
.container {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.footer{
position: fixed;
z-index: 10000;
bottom:0;
left:0;
width: 100%;
text-align: center;
padding: 0;
}
.footer button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff;border-radius:0;}
.myaddress-box{display: flex;flex-direction: column;flex-grow: 1; align-items: center;justify-content: center;width:100%; padding:0; box-sizing: border-box;}
.myaddress-item{width:100%; padding:0.8em; box-sizing: border-box;border:1px solid #f1f1f1; background-color:#fff;border-radius:0.5em;}
.myaddress-contact{width:100%;}
.myaddress-bottom{width:100%;margin-top:0.5em; display: flex;flex-direction: row; align-items: center;justify-content: center;}
.myaddress-bottom .myaddress-btn{width:100%;}
.myaddress-bottom .myaddress-btn image{width:1.2em;height:1.2em; vertical-align: middle;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.myaddress-box .frombody{padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.myaddress-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.myaddress-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view.area input{width:12.8em;}
.myaddress-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.upimage_box text{width: 12.8em;}
.myaddress-box .frombody view.upimage_box .image{border: 0;}
.myaddress-box .frombody view.upimage_box .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.myaddress-box .frombody view.upimage0_box{flex-direction: column;}
.myaddress-box .frombody view.upimage0_box view{border: 0;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to{flex-direction:row}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image{flex-direction:column}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image text{font-size: 0.85em;}
.myaddress-box .frombody view.upimage0_box .upimage0_box_to .image image{width:4em;height:4em;border:1px solid #f1f1f1;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.section{position: relative; bottom:0; width:90%; height:20em; padding: 0 1em; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.section .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.section .close image{width:100%;height:100%;}
.section-title{width:100%;height:2.5em; line-height: 2.5em; text-align: center; font-weight: 600;border-bottom:1px solid #f1f1f1;}
.section-body{width:100%;}
.section-body view{width:100%;display: flex;flex-direction: row; align-items: center;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height:1.5em;}
.section-body view text{color:#000;}
.section-body view .picker_hx{color:#939393;line-height:2.5em;}
.section-body view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:10em; padding-left:1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;line-height:2em;}
.section-body view .picker_hx image{position: absolute; top:1em;right:0.6em; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.area .picker_hx{display: flex;flex-direction:row;}
.myaddress-box .frombody view.area .picker_hx input{position: absolute; top:0.6em;right:1.6em;}
.center{
width: 4em;
height: 4em;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

960
pages/my/index.js Normal file
View File

@@ -0,0 +1,960 @@
var WxParse = null;
var app = getApp()
var that = null
var that0 = null
var sopenFrame = null
Page({
data: {
avatarUrl: "",
NCName: "您还没有登录,请先登录!",
UserName: "",
uLevel: "普通会员",
serverHidden: true,
authorizeHidden: true,
authorizetitle: "确认授权",
myagentHidden: true,
servermsg: "",
IFagent: 0,
uLevel1: "",
sjuLevel: 0,
sjuLevel0: 0,
dluLevel: 0,
tgyuLevel: 0,
IFYGM: 0,
xjjye: "0.00",
btjye: "0.00",
tgmeye: 0,
jhmye: 0,
xjye: "0.00",
mfye: "0.00",
gxzye: "0.00",
zzedye: "0.00",
ggzye: "0.00",
yjhsjnum: 0,
ordercount: 0,
ordercount0: 0,
ordercount1: 0,
ordercount2: 0,
logout: "安全退出",
yqm: "",
ifshowzzjf: 1,
voucherNum:0.00, //兑换券数量
isSignToday:false //今天是否已签到
},
onShow: function () {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
that0 = this;
var userId = wx.getStorageSync("userId")
var userInfodata = wx.getStorageSync("userInfo")
var sel = 3;
var ifsel = 0;
if (userId && userInfodata) {
var userInfo = JSON.parse(userInfodata)
ifsel = userInfo.bdshEnable;
that0.GetSignInfo();
}
if (ifsel == 1) {
sel = 3;
that0.getTabBar().setData({
"list": [{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
} else {
that0.getTabBar().setData({
"list": [{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/business/index",
"iconPath": "/images/footer-icon-02.png",
"selectedIconPath": "/images/footer-icon-02-active.png",
"text": "门店"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
}
that0.getTabBar().setData({
selected: sel
})
}
},
onLoad: function () {
WxParse = require('../../wxParse/wxParse.js');
that = this
wx.setBackgroundColor({
backgroundColor: "#00B050",
})
that.rdata(0)
sopenFrame = setInterval(function () {
if (app.globalData.IFRefreshmy == 1) {
app.globalData.IFRefreshmy = 0
that.rdata(0)
}
}, 1000);
},
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
app.globalData.IFRefreshindex = 1
that.rdata(1)
},
rdata: function (t) {
var servermsg = wx.getStorageSync("servermsg")
if (servermsg) {
WxParse.wxParse('servermsg', 'html', servermsg, that)
}
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && LoginId && userInfodata) {
var userInfo = JSON.parse(userInfodata)
var UserPic = (userInfo.UserPic == "" ? "../../images/logo.png" : userInfo.UserPic)
var NCName = userInfo.RealName;
var userlist = [{
icon: '../../images/iconfont-user.png',
url: '../myusers/index',
text: '我的会员'
}, {
icon: '../../images/iconfont-user.png',
url: '../myskusers/index',
text: '我的锁客'
}, {
icon: '../../images/iconfont-tgm.png',
url: '../mytgm/index',
text: '我的邀请码'
}, {
icon: '../../images/iconfont-favorite.png',
url: '../myfavorite/index',
text: '我的收藏'
}, {
icon: '../../images/iconfont-kefu.png',
url: '../mykf/index',
text: '联系客服'
}, {
icon: '../../images/iconfont-set.png',
url: '../myto/index',
text: '个人设置'
}];
if (userInfo.id > 68 && userInfo.bdshEnable == 0) {
userlist = [
{
icon: '../../images/iconfont-online.png',
url: (userInfo.sjuLevel0 == 2 ? '../mybusiness0/index' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')),
text: (userInfo.sjuLevel0 == 2 ? '事业部管理' : (userInfo.sjuLevel0 == 1 ? '申请线上供应链正在审核中...' : '申请门店'))
},
{
icon: '../../images/iconfont-user.png',
url: '../myusers/index',
text: '我的会员'
}, {
icon: '../../images/iconfont-user.png',
url: '../myskusers/index',
text: '我的锁客'
}, {
icon: '../../images/iconfont-tgm.png',
url: '../mytgm/index',
text: '我的邀请码'
}, {
icon: '../../images/iconfont-favorite.png',
url: '../myfavorite/index',
text: '我的收藏'
}, {
icon: '../../images/iconfont-kefu.png',
url: '../mykf/index',
text: '联系客服'
}, {
icon: '../../images/iconfont-set.png',
url: '../myto/index',
text: '个人设置'
}
];
}
if ((userInfo.ifyjhsj > 0 || userInfo.sjuLevel > 0) && userInfo.id > 68 && userInfo.bdshEnable == 0) {
userlist = [{
icon: '../../images/iconfont-offline.png',
url: (userInfo.sjuLevel == 2 ? '../mybusiness/index' : (userInfo.sjuLevel == 1 ? '正在审核中,请等待审核再来' : '../appbusiness/index')),
text: (userInfo.sjuLevel == 2 ? '联盟商家管理' : (userInfo.sjuLevel == 1 ? '申请线下商家正在审核中...' : '申请线下商家(联盟商家)'))
},
/*
{
icon: '../../images/iconfont-online.png',
url:(userInfo.sjuLevel0==2?'../mybusiness0/index':(userInfo.sjuLevel0==1?'正在审核中,请等待审核再来':'../appbusiness0/index')),
text: (userInfo.sjuLevel0==2?'事业部管理':(userInfo.sjuLevel0==1?'申请线上供应链正在审核中...':'申请线上供应链(事业部)'))
},
*/
{
icon: '../../images/iconfont-user.png',
url: '../myusers/index',
text: '我的会员'
}, {
icon: '../../images/iconfont-user.png',
url: '../myskusers/index',
text: '我的锁客'
}, {
icon: '../../images/iconfont-tgm.png',
url: '../mytgm/index',
text: '我的邀请码'
}, {
icon: '../../images/iconfont-favorite.png',
url: '../myfavorite/index',
text: '我的收藏'
}, {
icon: '../../images/iconfont-kefu.png',
url: '../mykf/index',
text: '联系客服'
}, {
icon: '../../images/iconfont-set.png',
url: '../myto/index',
text: '个人设置'
}
]
}
that.setData({
userListInfo: userlist
})
that.setData({
avatarUrl: (UserPic != "" ? UserPic : ""),
NCName: NCName,
UserName: userInfo.UserName,
uLevel: userInfo.uLevel,
uLevel1: userInfo.uLevel1,
sjuLevel: userInfo.sjuLevel,
sjuLevel0: userInfo.sjuLevel0,
dluLevel: userInfo.dluLevel,
tgyuLevel: userInfo.tgyuLevel,
IFYGM: userInfo.IFYGM,
xjjye: userInfo.xjjye,
btjye: userInfo.btjye,
tgmeye: userInfo.tgmeye,
jhmye: userInfo.jhmye,
xjye: userInfo.xjye,
mfye: userInfo.mfye,
gxzye: userInfo.gxzye,
zzedye: userInfo.zzedye,
ggzye: userInfo.ggzye,
yjhsjnum: userInfo.yjhsjnum,
ifshowzzjf: userInfo.ifshowzzjf,
loadingHidden: true
})
} else {
that.setData({
userListInfo: [{
icon: '../../images/iconfont-user.png',
url: '../myusers/index',
text: '我的会员'
}, {
icon: '../../images/iconfont-tgm.png',
url: '../mytgm/index',
text: '我的邀请码'
}, {
icon: '../../images/iconfont-favorite.png',
url: '../myfavorite/index',
text: '我的收藏'
}, {
icon: '../../images/iconfont-kefu.png',
text: '联系客服'
}, {
icon: '../../images/iconfont-set.png',
url: '../myto/index',
text: '个人设置'
}],
avatarUrl: "",
NCName: "您还没有登录,请先登录!",
uLevel: "普通会员",
IFYGM: 0,
sjuLevel: 0,
sjuLevel0: 0,
dluLevel: 0,
tgyuLevel: 0,
xjjye: "0.00",
tgmeye: 0,
jhmye: 0,
xjye: "0.00",
mfye: "0.00",
gxzye: "0.00",
zzedye: "0.00",
ggzye: "0.00",
ordercount: 0,
ordercount0: 0,
ordercount1: 0,
ordercount2: 0,
loadingHidden: true
})
}
if (t == 1) {
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
},
gotourl: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && LoginId && userInfodata) {
var index = e.currentTarget.dataset.id
if (index != 30) {
var userInfo = JSON.parse(userInfodata)
var url = that.data.userListInfo[index].url;
var b = true;
if (url == "正在审核中,请等待审核再来") {
wx.showToast({
title: url,
icon: "none",
duration: 3000
})
b = false;
}
if (b) {
wx.navigateTo({
url: url
})
}
} else {
that.setData({
serverHidden: false
})
}
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
gouserinfo: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && LoginId && userInfodata) {
wx.navigateTo({
url: "../myto/index"
})
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
onhuazhuan: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && LoginId && userInfodata) {
wx.navigateTo({
url: "../zhuanhuan/index"
})
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
onduihuan: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && LoginId && userInfodata) {
wx.navigateTo({
url: "../duihuan/index"
})
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
onkttgy: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var t = e.currentTarget.dataset.id
if (userId && LoginId && userInfodata) {
wx.navigateTo({
url: "../kttgy/index?t=" + t
})
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
onauthorize: function () {
wx.authorize({
scope: 'scope.userInfo',
success() {
that.getUserInfoto(1)
}
})
that.setData({
authorizeHidden: true
})
},
closeauth: function (e) {
that.setData({
authorizeHidden: true
})
},
closemyagent: function (e) {
that.setData({
myagentHidden: true
})
},
getUserInfoto: function (t) {
wx.getUserInfo({
success: function (res1) {
var userInfo = res1.userInfo
var nickName = userInfo.nickName
var avatarUrl = userInfo.avatarUrl
var gender = userInfo.gender //性别 0未知、1男、2
var province = userInfo.province
var city = userInfo.city
var country = userInfo.country
that.setData({
authorizetitle: "授权中..."
})
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action: "updateWxUserInfo",
userId: (!userId ? "" : userId),
LoginId: (!LoginId ? "" : LoginId),
ncname: nickName,
avatar: avatarUrl,
gender: gender,
province: province,
city: city,
country: country
},
method: "POST",
dataType: "json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success(res2) {
wx.setStorageSync('userInfo', JSON.stringify(res2.data.userInfo))
app.globalData.IFRefreshmy = 1
if (t == 1) {
wx.showToast({
title: "授权成功",
icon: "success",
duration: 3000
})
}
that.setData({
authorizeHidden: true,
authorizetitle: "确认授权",
avatar: res2.data.avatar
})
}
})
}
})
},
closeserver: function (e) {
that.setData({
serverHidden: true
})
},
inserver: function (e) {
},
inauth: function (e) {
},
onnews: function (e) {
var t = e.currentTarget.dataset.id
if (t == 2) {
wx.navigateTo({
url: "../news/index"
})
} else {
wx.navigateTo({
url: "../news/index"
})
}
},
onWithdrawal: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
var t = e.currentTarget.dataset.id
wx.navigateTo({
url: "../withdrawal/index?t=" + t
})
}
},
onincome: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
wx.navigateTo({
url: "../myincome/index"
})
}
},
oncz: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
wx.navigateTo({
url: "../chongzhi/index"
})
}
},
onzz: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var t = e.currentTarget.dataset.id
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
wx.navigateTo({
url: "../zhuanzhang/index?t=" + t
})
}
},
onzh: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
wx.navigateTo({
url: "../zhuanhuan/index"
})
}
},
onbalance: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
var t = e.currentTarget.dataset.id
if (t == 9) {
wx.navigateTo({
url: "../zzjf/index"
})
} else {
wx.navigateTo({
url: "../mybalance/index?t=" + t
})
}
}
},
onSignInList:function(e)
{
console.log("跳转到兑换券记录列表");
wx.navigateTo({
url: "../checkin_log/index"
})
},
onbonus: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
var t = e.currentTarget.dataset.id
wx.navigateTo({
url: "../mybonus/index?t=" + t
})
}
},
onpt: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
var t = e.currentTarget.dataset.id
wx.navigateTo({
url: "../mypt/index?t=" + t
})
}
},
onorder: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var ifdl = true;
if (!userId || !LoginId) {
ifdl = false;
wx.navigateTo({
url: "../login/index"
})
} else {
var userInfo = JSON.parse(userInfodata);
if (userInfo.Phone == "") {
ifdl = false;
wx.showToast({
title: "您还没有绑定手机号",
icon: "none",
duration: 2000
})
wx.navigateTo({
url: "../myphone/index"
})
}
}
if (ifdl) {
var nav = e.currentTarget.dataset.id
var t = e.currentTarget.dataset.index
wx.navigateTo({
url: "../myorder/index?t=" + t + "&nav=" + nav
})
}
},
logout: function (e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if (userId && LoginId) {
wx.showModal({
title: '安全提示',
content: '您确认要退出系统吗?',
success(res0) {
if (res0.confirm) {
that.setData({
logout: "请稍候..."
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action: "logout",
userId: (!userId ? "" : userId),
LoginId: (!LoginId ? "" : LoginId)
},
method: "POST",
dataType: "json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success(res) {
wx.removeStorageSync('userId')
wx.removeStorageSync('LoginId')
wx.removeStorageSync('userInfo')
app.globalData.IFLogin = 0
app.globalData.IFRefreshmy = 1
app.globalData.IFRefreshindex = 1
sopenFrame = setInterval(function () {
clearInterval(sopenFrame);
that.setData({
logout: "安全退出"
})
wx.navigateBack({})
wx.navigateTo({
url: "../login/index"
})
}, 1000)
}
})
}
}
})
} else {
wx.navigateTo({
url: "../login/index"
})
}
},
copy: function (e) {
var font = e.currentTarget.dataset.font
wx.setClipboardData({
data: font,
success: function (res) {
wx.showToast({
title: "复制成功"
})
}
})
},
onSignIn : function(e){
console.log("开始签到");
var that = this
var userId = wx.getStorageSync("userId")
if (userId) {
wx.request({
url: app.globalData.apiurl + "/api/api.ashx?action=user_sign_in",
data: { userId: (!userId ? "" : userId) },
method: "POST",
dataType: "json",
header: {"content-type": "application/x-www-form-urlencoded"},
success(res) {
if(res.data.status==1)
{
that.setData({
isSignToday: true,
voucherNum: res.data.point
})
console.log("签到成功");
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
}else{
console.log("签到失败");
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
}
}
})
}
},
GetSignInfo: function (e) {
var that = this
var userId = wx.getStorageSync("userId")
var userInfodata = wx.getStorageSync("userInfo")
if (userId && userInfodata) {
wx.request({
url: app.globalData.apiurl + "/api/api.ashx?action=user_sign_info",
data: { userId: (!userId ? "" : userId) },
method: "POST",
dataType: "json",
header: {"content-type": "application/x-www-form-urlencoded"},
success(res) {
if(res.data.status==1)
{
that.setData({
isSignToday: true,
voucherNum: res.data.point
})
}else{
that.setData({
isSignToday: false,
voucherNum: res.data.point
})
}
}
})
}
},
catchyqm: function (e) {}
})

4
pages/my/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "我的"
}

242
pages/my/index.wxml Normal file
View File

@@ -0,0 +1,242 @@
<import src="../../wxParse/wxParse.wxml" />
<view class="container">
<view class='userinfo {{IFagent==1?"agent":""}}'>
<view class="userinfo-avatar" bindtap="gouserinfo">
<image src='{{avatarUrl==""?"../../images/logo.png":avatarUrl}}'></image>
</view>
<view class="userinfo-box" bindtap="gouserinfo">
<text class="userinfo-nickname">{{NCName}}{{NCName!="您还没有登录,请先登录!"?"("+uLevel + ")":""}}</text>
<view class="userinfo-uLevel" wx:if='{{NCName!="您还没有登录,请先登录!"}}'>
<text>账号:{{UserName}}</text>
</view>
</view>
<view class="userinfo-icon" bindtap="gouserinfo">
<image src="../../images/icon-arrowdown0.png"></image>
</view>
</view>
<view class="balance-box0" style="z-index: 1; margin-top:-2.8em;">
<view class="balance-box0-to">
<view class="balance-title">我的资产</view>
<view class="balance-item" style="padding-bottom: 0.8em;">
<view class="item-left">
<view class="item-left-item">
<view>
<view class="item-image image-color0" bindtap="onbalance" data-id="1">
<image src="../../images/jifen_ico0.png"></image>
</view>
<view class="item-font" bindtap="onbalance" data-id="1">
<view class="title">余额</view>
<view class="money" style="margin-left: 0.5em;">{{xjjye}}</view>
</view>
</view>
<view>
<view class="item-image image-color0" bindtap="onSignInList" data-id="27">
<image src="../../images/jifen_ico1.png"></image>
</view>
<view class="item-font" bindtap="onSignInList">
<view class="title">兑换券</view>
<view class="money" style="margin-left: 0.2em;">{{voucherNum}}</view>
</view>
</view>
<view>
<button wx:if='{{NCName!="您还没有登录,请先登录!"}}' class="signin-btn" bindtap="onSignIn">{{isSignToday ? "已签到":"立即签到"}}</button>
</view>
</view>
</view>
<view class="item-right" wx:if="{{ifshowzzjf==1}}">
</view>
</view>
<!-- <view class="balance-item" style="padding-top: 0.4em;padding-bottom: 0.8em;" wx:if="{{tgyuLevel==0}}">
<view class="item-left" bindtap="onbalance" data-id="21">
<view class="item-left-item">
<view class="item-image image-color3"><image src="../../images/jifen_ico0.png"></image></view>
<view class="item-font">
<view class="title">激活码</view>
<view class="money">{{jhmye}}</view>
</view>
</view>
</view>
<view class="item-right">
<view class="button" bindtap="onkttgy">
激活商家
</view>
</view>
</view>-->
<!--<view class="balance-item" style="padding-top: 0.4em;">
<view class="item-left" bindtap="onbalance" data-id="4">
<view class="item-left-item">
<view class="item-image image-color1"><image src="../../images/jifen_ico0.png"></image></view>
<view class="item-font">
<view class="title">佣金</view>
<view class="money">{{xjye}}</view>
</view>
</view>
</view>
<view class="item-right" bindtap="onbalance" data-id="18">
<view class="item-image image-color1"><image src="../../images/jifen_ico0.png"></image></view>
<view class="item-font">
<view class="title">广告值</view>
<view class="money">{{ggzye}}</view>
</view>
</view>
</view>-->
</view>
</view>
<div class="clear"></div>
<view class="balance-box0" style="z-index: 1; margin-top:0.8em;" wx:if="{{dluLevel>2}}">
<view class="balance-box0-to">
<view class="balance-title">代理管理({{uLevel1}}</view>
<view class="balance-item" style="padding-bottom: 0.8em;">
<view class="item-left">
<view class="item-left-item">
<view class="item-image image-color0" bindtap="onbalance" data-id="2">
<image src="../../images/jifen_ico0.png"></image>
</view>
<view class="item-font" bindtap="onbalance" data-id="22">
<view class="title">推广名额</view>
<view class="money">{{tgmeye}}</view>
</view>
</view>
</view>
<view class="item-right">
<view class="button" bindtap="onkttgy" data-id="0">
开通城市合伙人
</view>
</view>
</view>
</view>
</view>
<div class="clear"></div>
<view class="balance-box0" style="z-index: 1; margin-top:0.8em;" wx:if="{{tgyuLevel>1}}">
<view class="balance-box0-to">
<view class="balance-title">城市合伙人</view>
<view class="balance-item" style="padding-bottom: 0.8em;">
<view class="item-left">
<view class="item-left-item">
<view class="item-image image-color0" bindtap="onbalance" data-id="2">
<image src="../../images/jifen_ico0.png"></image>
</view>
<view class="item-font" bindtap="onkttgy" data-id="1">
<view class="title">已激活商家</view>
<view class="money">{{yjhsjnum}}</view>
</view>
</view>
</view>
<view class="item-right">
<view class="button" bindtap="onkttgy" data-id="1">
激活商家
</view>
</view>
</view>
</view>
</view>
<div class="clear"></div>
<view class="balance-box0">
<view class="pintuan-box">
<view class="pintuan-title"><text>订单管理</text>
<view class="more" bindtap="onorder" data-id="0" data-index="0">全部</view>
</view>
<view class="pintuan-box-to">
<view class="pintuan-item" bindtap="onorder" data-id="1" data-index="0">
<view class="item-image">
<image src="../../images/order_ico6.png" />
</view>
<view class="item-title">待付款</view>
</view>
<view class="pintuan-item" bindtap="onorder" data-id="2" data-index="0">
<view class="item-image">
<image src="../../images/order_ico0.png" />
</view>
<view class="item-title">待发货</view>
</view>
<view class="pintuan-item" bindtap="onorder" data-id="3" data-index="0">
<view class="item-image">
<image src="../../images/order_ico1.png" />
</view>
<view class="item-title">待收货</view>
</view>
<view class="pintuan-item" bindtap="onorder" data-id="4" data-index="0">
<view class="item-image">
<image src="../../images/order_ico2.png" />
</view>
<view class="item-title">已完成</view>
</view>
</view>
</view>
</view>
<div class="clear"></div>
<view class="balance-title" wx:if="{{IFagent==0}}">其它</view>
<div class="clear"></div>
<view class="info_list">
<block wx:for="{{userListInfo}}" wx:for-index="index">
<view class="weui_cell" bindtap="gotourl" data-id="{{index}}">
<view class="weui_cell_hd">
<image src="{{item.icon}}"></image>
</view>
<view class="weui_cell_bd">
<view class="weui_cell_bd_p"> {{item.text}} </view>
</view>
<view wx:if="{{item.isunread}}" class='badge{{item.unreadNum<10?" badge0":""}}'>{{item.unreadNum}}</view>
<view class="with_arrow"></view>
</view>
</block>
</view>
<div class="clear"></div>
<view class="logoutbutton">
<button bindtap="logout">{{logout}}</button>
</view>
</view>
<view class="Hidden_box" hidden="{{serverHidden}}" bindtap="closeserver">
<view class="Hidden_box_to" catchtap="inserver">
<view class="close" bindtap="closeserver">
<image src="../../images/close.png" />
</view>
<view class="body">
<template is="wxParse" data="{{wxParseData:servermsg.nodes}}" />
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden}}" bindtap="closeauth">
<view class="Hidden_box_to" catchtap="inauth">
<view class="title">微信授权</view>
<view class="close" bindtap="closeauth">
<image src="../../images/close.png" />
</view>
<view class="body">
<view>为了给您提供更好的服务,需要获取您的微信头像和昵称</view>
<button id="getUserInfo" open-type="getUserInfo" bindgetuserinfo="onauthorize">{{authorizetitle}}</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{myagentHidden}}" bindtap="closemyagent">
<view class="Hidden_box_to gotoagent" catchtap="inauth">
<view class="title">温馨提醒</view>
<view class="close" bindtap="closemyagent">
<image src="../../images/close.png" />
</view>
<view class="body">
<view>您还不是代理,是否现在去申请成为代理?</view>
<button class="closebtn" bindtap="closemyagent">否</button>
<button bindtap="ongotoagent">是</button>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

577
pages/my/index.wxss Normal file
View File

@@ -0,0 +1,577 @@
/**index.wxss**/
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.clear{ height:0;clear:both;}
.userinfo {
position: relative;
float: left;
display: flex;
height:11em;
flex-direction: row;
padding: 70rpx 0;
align-items: center;
background: linear-gradient(to bottom,#00B050,#019042);
}
.userinfo.agent{
background: linear-gradient(to bottom,#eb15d4,#850a78);
}
.userinfo-avatar {
float: left;
width: 4em;
height: 4em;
margin: 1em;
margin-top: 0em;
padding:0.1em;
border-radius: 50%;
background-color: #f1f1f1;
box-sizing: border-box;
overflow: hidden;
}
.userinfo-avatar image{
width:100%;
height:100%;
border-radius: 50%;
}
.userinfo-box{
margin-top: -0.8em;
display: flex;
flex-direction: column;
max-width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
}
.userinfo-nickname {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.userinfo-uLevel {
margin-top: 1em;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
min-width:12em;
padding: 0.4em 0.4em;
line-height:1.2em;
font-size: 12px;
overflow: hidden;
background-color: #474758;
border-radius: 1em;
box-sizing: border-box;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
}
.signin-btn {
font-size: 13px;
padding: 0.2em 0.6em;
height: auto;
line-height: 1.2;
margin-left: 0.4em;
background: linear-gradient(to right, #00B050, #00B050);
color: white;
border: none;
border-radius: 0.5em;
font-weight: 600;
white-space: nowrap;
}
.signin-btn::after {
border: none;
}
.userinfo-uLevel image{
width:1.2em;
height:1.2em;
vertical-align: middle;
margin-right:0.2em;
}
.userinfo-yqm {
display: flex;
flex-direction: row;
margin-top: 0.5em;
}
.userinfo-yqm view{
margin-left:0.3em;
padding:0;
width:3em;
height:1.5em;
line-height: 1.5em;
font-size: 0.8em;
text-align: center;
border-radius:0.5em;
border:1px solid #f1f1f1;
color:#FBF804;
}
.userinfo-icon{
position: absolute;
top:8.1em;
right:1em;
width:1.2em;
height:auto;
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-icon image{
width:100%;
height:1.2em;
}
.userinfo-button{
position: absolute;
top:8.3em;
right:1em;
height:auto;
display: flex;
flex-direction: column;
align-items: center;
}
.agent-balance-box{
display: block;
float:left;
margin: 0;
margin-top: 0em;
padding:1em 0.8em;
box-sizing: border-box;
width: 100%;
color: #000;
background-color: #fff;
}
.agent-balance-box .balance{
float: left;
margin: 0;
display: block;
width:auto;
height:2em;
line-height: 2em;
font-size: 1em;
font-weight: 600;
}
.agent-balance-box .balance.balance0{
margin-left:0.5em;
}
.agent-balance-box .balance text{
font-size: 0.75em;
font-weight:normal;
}
.agent-balance-box .button{
float: right;
margin: 0;
margin-top:0em;
display: block;
width:5em;
height:2em;
text-align: center;
line-height: 2em;
background:linear-gradient(to right,#00B050,#00B050);
color:#fff;
border-radius:0.5em;
}
.qhshow-box{
position: absolute;
bottom:0.5em;
right:0;
width:8em;
height:2.2em;
}
.qhshow-box button{
width: 100%;
height: 100%;
line-height:2.2em;
text-align: center;
background:linear-gradient(to bottom,#eb15d4,#850a78);
color: #fff;
font-size: 1em;
border-radius:0.5em 0 0 0.5em;
}
.qhshow-box.agent button{
background:linear-gradient(to right,#00B050,#00B050);
}
.balance-box{
display:flex;
flex-direction:column;
margin-top: -4em;
padding:0 0.8em;
z-index:10;
box-sizing: border-box;
width: 100%;
align-items: center;
justify-content: center;
}
.balance-box .balance-box-to{
display:flex;
flex-direction: row;
width: 100%;
height:3em;
border-radius:0.5em 0.5em 0 0;
background-color: #fff;
}
.balance-box .balance-item{
display:flex;
width: 50%;
padding: 1em;
box-sizing: border-box;
}
.balance-box .balance-item .item-font{
display: flex;
flex-direction:column;
flex-flow: 1;
padding-left: 0.5em;
box-sizing: border-box;
color:#848484;
align-items: center;
}
.balance-box .balance-item .item-font .money{
color: #ff0000;
}
.balance-box .balance-item .button{
display:flex;
width:100%;
height:2em;
align-items: center;
justify-content: center;
line-height: 2em;
background:linear-gradient(to right,#00B050,#00B050);
color: #fff;
border-radius:0.5em;
box-sizing: border-box;
}
.balance-title{width:100%; height: 2.5em; line-height: 2.5em; padding:0 1em;box-sizing: border-box;}
.balance-box0{
display: flex;
flex-direction:column;
padding: 0 0.8em;
padding-top: 0;
width: 100%;
box-sizing: border-box;
}
.balance-box0 .balance-box0-to{
display:flex;
flex-direction:column;
width: 100%;
border-radius:0.5em;
background-color: #fff;
}
.balance-box0 .balance-title{
font-weight: 800;
font-size: 1em;
}
.balance-box0 .balance-item{
display: flex;
flex-direction:row;
width: 100%;
align-items: center;
justify-content: center;
}
.balance-box0 .balance-item .item-left{
display: flex;
flex-direction:column;
width:58%;
padding: 0.8em;
padding-bottom: 0;
box-sizing: border-box;
}
.balance-box0 .balance-item .item-left .item-left-item{
display: flex;
flex-direction:row;
width:100%;
padding: 0;
box-sizing: border-box;
align-items: center;
}
.balance-box0 .balance-item .item-left .item-left-item > view{
display: flex;
flex-direction:row;
align-items: center;
}
.balance-box0 .balance-item .item-left .item-left-item .button{
display:flex;
margin-left: 0.4em;
margin-top: 0.4em;
width:4em;
height:1.6em;
align-items: center;
justify-content: center;
line-height: 1.6em;
background:linear-gradient(to right,#00B050,#00B050);
color: #fff;
border-radius:0.5em;
box-sizing: border-box;
}
.dhmsg{
display:flex;
width: 100%;
padding:0.8em;
padding-top: 0;
box-sizing: border-box;
color:#848484;
}
.balance-box0 .balance-item .item-right{
display: flex;
flex-direction:row;
width:42%;
padding: 0.8em;
padding-bottom: 0;
box-sizing: border-box;
}
.balance-box0 .balance-item .item-right .button{
display:flex;
margin-top: 0;
width:100%;
height:2.5em;
padding: 0.4em 0;
align-items: center;
justify-content: center;
text-align: center;
line-height: 1.2em;
background:linear-gradient(to right,#00B050,#00B050);
color: #fff;
border-radius:0.5em;
box-sizing: border-box;
}
.balance-box0 .balance-item .item-image{
display: flex;
width:2em;
height: 2em;
padding: 0.5em;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
border-radius: 50%;
}
.image-color0{
background-color: #00B050;
}
.image-color1{
background-color: #0dc1ae;
}
.image-color2{
background-color: #9a0b95;
}
.image-color3{
background-color: #eab104;
}
.image-color4{
background-color: #0dc1ae;
}
.image-color5{
background-color: #3313ac;
}
.balance-box0 .balance-item .item-image image{
width:100%;
height:100%;
}
.balance-box0 .balance-item .item-font{
display: flex;
flex-direction:row;
align-items: center;
flex: 1;
padding-left: 0.5em;
box-sizing: border-box;
}
.balance-box0 .balance-item .item-left .item-font{
width:6em;
}
.balance-box0 .balance-item .item-font .money{
color: #00B050;
}
.pintuan-box{
display:flex;
flex-direction: column;
margin-top: 0.8em;
padding:0.8em;
z-index:10;
box-sizing: border-box;
width: 100%;
align-items: center;
justify-content: center;
border-radius:0.5em;
background-color: #fff;
}
.pintuan-title{
display:flex;
flex-direction: row;
width: 100%;
}
.pintuan-title text{
flex-grow: 1;
font-weight: 800;
}
.pintuan-title .more{
width:auto;
}
.pintuan-box .pintuan-box-to{
display:flex;
flex-direction: row;
margin-top: 0.8em;
width: 100%;
border-top:1px solid #f1f1f1;
}
.pintuan-box .pintuan-item{
display:flex;
flex-direction: column;
margin-top: 0.8em;
flex: 1;
align-items: center;
justify-content: center;
}
.pintuan-box .pintuan-item .item-font{
font-size: 1.2em;
font-weight: 600;
color:#ff4d00;
}
.pintuan-box .pintuan-item .item-title{
}
.pintuan-box .pintuan-item .item-image{
}
.pintuan-box .pintuan-item .item-image image{
width:1.2em;
height:1.2em;
}
.mydata_box{
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height:3em;
background-color: #f52c32;
}
.mydata_box view{
margin-top:0.5em;
width: 50%;
height: 2em;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
box-sizing: border-box;
}
.mydata_box view.umoney1{
border-left:1px solid #f1f1f1;
}
.mydata_box view image{
width: 1.5em;
height: 1.5em;
margin-right: 0.3em;
}
.mydata_box0{
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height:8em;
background-color: #fff;
}
.mydata_box0 view{
margin-top:0.5em;
width: 33.33333333333%;
height: 6em;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #000;
box-sizing: border-box;
}
.mydata_box0 view.umoney1{
border-left:1px solid #f1f1f1;
}
.mydata_box0 view image{
width: 4em;
height: 4em;
}
.mydata_box0 view view{
display: flex;
flex-direction: column;
}
.info_list{padding: 0 0.8em;}
.weui_cell{
position: relative;
margin-bottom:0.5em;
display: flex;
padding: 15px;
box-sizing: border-box;
border-radius: 0.5em;
background-color: #fff;
align-items: center;
}
.weui_cell_hd{
display: inline-block;
width: 20px;
margin-right: 5px;
}
.weui_cell_hd image{
width: 100%;
height: 20px;
vertical-align: -2px;
}
.weui_cell_bd{
display: inline-block;
}
.weui_cell_bd_p{
color: #939393;
}
.badge{
position: absolute;
top: 1.9em;
right: 3.5em;
width: auto;
padding:0.3em;
padding-right:0.4em;
background: #ff0000;
color: #fff;
border-radius: 50%;
text-align: center;
font-size: 0.7em;
box-sizing: border-box;
}
.badge0{
padding:0.1em 0.4em;
}
.with_arrow{
position: absolute;
top: 18px;
right: 15px;
width: 15px;
height: 15px;
background-image: url('data:image/png;base64,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');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.logoutbutton{width: 100%; margin-bottom: 6em; padding:0.8em; box-sizing: border-box;}
.logoutbutton button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 100;}
.Hidden_box_to{position: relative; padding: 8px; width:90%;height:auto; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.Hidden_box_to.addcart_box{ position: absolute; bottom:0; width:100%;border-radius:0.5em 0.5em 0 0;}
.Hidden_box_to .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.Hidden_box_to .close image{width:100%;height:100%;}
.Hidden_box_to .title{width:100%;height:2.5em;}
.Hidden_box_to .body{line-height:1em;}
.Hidden_box_to .body button::after{border:0;}
.Hidden_box_to .body button{margin-top:0.5em;background:linear-gradient(to right,#00B050,#00B050);color:#fff; border-radius:0.5em;}
.Hidden_box_to.gotoagent .body{padding:1em 0; line-height: 1.2em;}
.Hidden_box_to.gotoagent .body button{float: left;margin-top:1.5em; width:49%;height:2em; line-height:2em;}
.Hidden_box_to.gotoagent .body button.closebtn{margin-right: 2%; background:#eee; color:#aaa;}

314
pages/myaddress/index.js Normal file
View File

@@ -0,0 +1,314 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
loadingHidden:false,
weixinbutton:"一键获取微信收货地址",
myaddress:[]
},
onLoad: function() {
that = this
that.rdata(0)
sopenFrame=setInterval(function (){
if(app.globalData.IFRefreshmyaddress==1){
that.rdata()
app.globalData.IFRefreshmyaddress=0
}
}, 1000);
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.rdata(1);//第一次加载数据
},rdata: function(t) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getAddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var qygm = wx.getStorageSync("qygm")
if(qygm){
that.setData({
selectHidden:false
})
}else{
that.setData({
selectHidden:true
})
}
that.setData({
myaddress:res.data.data
})
if(res.data.data.length==0){
wx.removeStorageSync('editaddress')
wx.navigateTo({
url: "../myaddress_add/index"
})
}
that.setData({
loadingHidden:true
})
}
if(t==0){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},select:function(e) {
var index = e.currentTarget.dataset.id
var id=that.data.myaddress[index].addressId
var contact=that.data.myaddress[index].contact
var tel=that.data.myaddress[index].tel
var area=that.data.myaddress[index].area
var detail=that.data.myaddress[index].detail
var Province=that.data.myaddress[index].Province
var qygm = wx.getStorageSync("qygm")
if(qygm){
app.globalData.selladdress={id:id,contact:contact,tel:tel,address:area+detail,Province:Province}
app.globalData.IFRefreshsell=1
wx.removeStorageSync('qygm')
wx.navigateBack({})
}
},isDefault:function(e) {
var index = e.currentTarget.dataset.id
var id=that.data.myaddress[index].addressId
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"setDefaultAddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
addressId:id
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 2000
})
that.rdata()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 2000
})
}
}
})
},isDefaulted:function(e) {
var index = e.currentTarget.dataset.id
var id=that.data.myaddress[index].addressId
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"setDefaultAddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
t:1,
addressId:id
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 2000
})
that.rdata()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 2000
})
}
}
})
},getweixinaddress:function(e) {
that.setData({
weixinbutton:"请稍候..."
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.address']) {
wx.authorize({
scope: 'scope.address',
success () {
that.addweixinaddress()
}
})
}else{
that.addweixinaddress()
}
}
})
},addweixinaddress:function() {
wx.chooseAddress({
success (res) {
var userName=res.userName
var postalCode=res.postalCode
var provinceName=res.provinceName
var cityName=res.cityName
var countyName=res.countyName
var detailInfo=res.detailInfo
var nationalCode=res.nationalCode
var telNumber=res.telNumber
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userName!=""&&provinceName!=""&&cityName!=""&&telNumber!=""){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"addweixinaddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
contact:userName,
tel:telNumber,
provinceName:provinceName,
cityName:cityName,
countyName:countyName,
detail:detailInfo,
IFIndex:1
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
app.globalData.IFRefreshmyaddress=1
that.setData({
weixinbutton:"一键获取微信收货地址"
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
that.setData({
weixinbutton:"一键获取微信收货地址"
})
}
}
})
}
},fail (res) {
wx.showToast({
title: JSON.stringify(res),
icon: "none",
duration: 3000
})
}
})
},showaddaddress:function(e) {
wx.removeStorageSync('editaddress')
wx.navigateTo({
url: "../myaddress_add/index"
})
},showedit:function(e) {
var index = e.currentTarget.dataset.id
wx.setStorageSync('editaddress', JSON.stringify(that.data.myaddress[index]))
wx.navigateTo({
url: "../myaddress_add/index"
})
},delete:function(e) {
wx.showModal({
title: '删除提示',
content: '此操作不可恢复!您确认要删除吗?',
success (res0) {
if (res0.confirm) {
var index = e.currentTarget.dataset.id
var addressId=that.data.myaddress[index].addressId
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"deleteAddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
addressId:addressId
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.rdata()
that.setData({
weixinbutton:"一键获取微信收货地址"
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
that.setData({
weixinbutton:"一键获取微信收货地址"
})
}
}
})
}
}
})
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "收货地址"
}

View File

@@ -0,0 +1,31 @@
<view class="container">
<!--<view class="fromtitle" bindtap="getweixinaddress"><image src="../../images/weixin.png"></image><text>{{weixinbutton}}</text><image class="arrowdown" src="../../images/icon-arrowdown.png"></image></view>-->
<view class="myaddress-box" wx:for="{{myaddress}}" wx:for-index="index" >
<view class="myaddress-item">
<view class="myaddress-contact" bindtap="select" data-id="{{index}}">
<text>{{item.contact}} {{item.tel}}\n{{item.area}}{{item.detail}}</text>
</view>
<view class="myaddress-bottom">
<view class="myaddress-btn" style="float:left;padding-left:0;" wx:if="{{item.IFIndex==1}}" data-id="{{index}}"><image src="../../images/wuliu02.png" />默认地址</view>
<view class="myaddress-btn" style="padding-right:0;" bindtap="showedit" data-id="{{index}}"><image src="../../images/edit.png" />编辑</view>
<view class="myaddress-btn" bindtap="delete" data-id="{{index}}"><image src="../../images/Delete.png" />删除</view>
</view>
<view class="myaddress-IFIndex" bindtap="select" data-id="{{index}}" hidden="{{selectHidden}}">
使用
</view>
</view>
<view class="addaddress">
<button bindtap="showaddaddress">添加新地址</button>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,50 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.container .address-image {
width: 120px;
height: 120px;
}
.addaddress{position: fixed; bottom:1em; width:90%;}
.addaddress button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
.myaddress-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;padding:0.8em; box-sizing: border-box;}
.myaddress-item{float: left; position: relative; width:100%; margin-bottom:0em; padding:0.8em; box-sizing: border-box;border:1px solid #f1f1f1; background-color:#fff;border-radius:0.5em;}
.myaddress-contact{width:100%; line-height:1.5em;}
.myaddress-bottom{width:100%;margin:0;margin-top:1em;}
.myaddress-bottom .myaddress-btn{float: right; width:auto; margin: 0 0; padding: 0.5em; background-color:#fff; box-sizing: border-box; border-radius:0.5em;}
.myaddress-bottom .myaddress-btn image{width:1.2em;height:1.2em; vertical-align: middle;}
.myaddress-IFIndex{position: absolute;top:1.5em;right:0.5em;width:4em;height:2em; line-height: 2em; border:1px solid #c1c1c1;background-color:#fff; text-align: center; border-radius:0.5em; color:#000}
.myaddress-IFIndex image{width:100%;height:100%;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.myaddress-box .frombody{margin-top: 1em; padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.myaddress-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.myaddress-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view.area input{width:12.8em;}
.myaddress-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.button{border: 0;}
.myaddress-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background-color:#fd463e;color:#fff; border-radius:0.5em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.section{position: relative; bottom:0; width:90%; height:20em; padding: 0 1em; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.section .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.section .close image{width:100%;height:100%;}
.section-title{width:100%;height:2.5em; line-height: 2.5em; text-align: center; font-weight: 600;border-bottom:1px solid #f1f1f1;}
.section-body{width:100%;}
.section-body view{width:100%;display: flex;flex-direction: row; align-items: center;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height:1.5em;}
.section-body view text{color:#000;}
.section-body view .picker_hx{color:#939393;line-height:2.5em;}
.section-body view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:10em; padding-left:1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;line-height:2em;}
.section-body view .picker_hx image{position: absolute; top:1em;right:0.6em; width:1.2em;height:1.2em;}

View File

@@ -0,0 +1,458 @@
var app = getApp()
var that=null
var sopenFrame=null
var areas = null;
Page( {
data: {
loadingHidden:false,
contact:"",
tel:"",
detail:"",
selectHidden:true,
sectionHidden:true,
IFDefault:1,
savebutton:"保存",
weixinbutton:"一键获取微信收货地址",
Provinces:[],
Citys:[],
Countys:[],
tradingareas:[],
hx_index:-1,
hx_index0:-1,
hx_index1:-1,
hx_index2:-1,
area:"",
addressId:0,
weixinaddresshidden:false
},
onLoad: function() {
that = this
areas = require('../../area.js');
that.setData({
Provinces:areas.areaslist
})
that.rdata()
},rdata: function() {
var userInfodata = wx.getStorageSync("userInfo")
if(userInfodata){
var userInfo = JSON.parse(userInfodata)
var contact=""
if(userInfo.RealName){
contact=userInfo.RealName
}
var tel=userInfo.Phone
var Province=userInfo.Province
var City=userInfo.City
var County=userInfo.County
if(Province==""&&City==""&&County==""){
var Locationprovince = wx.getStorageSync("Locationprovince")
var Locationcity = wx.getStorageSync("Locationcity")
var Locationcounty = wx.getStorageSync("Locationcounty")
if(Locationprovince&&Locationcity&&Locationcounty){
Province=Locationprovince
City=Locationcity
County=Locationcounty
}
}
var index=-1
var index0=-1
var index1=-1
if(Province!=""&&City!=""&&County!=""){
var provinces=that.data.Provinces
for(var i=0;i<provinces.length;i++){
if(provinces[i].ProvinceID==Province){
index=i;
var citys=provinces[i].City;
for(var j=0;j<citys.length;j++){
if(citys[j].CityID==City){
index0=j;
var countys=citys[j].County;
for(var k=0;k<countys.length;k++){
if(countys[k].CountyID==County){
index1=k;
break;
}
}
break;
}
}
break;
}
}
}
that.setData({
hx_index: index,
savebutton:"添加"
})
var citys=(index==-1?[]:that.data.Provinces[index].City)
that.setData({
Citys:citys,
hx_index0: index0
})
var countys=(index0==-1?[]:that.data.Citys[index0].County)
that.setData({
Countys:countys,
hx_index1: index1
})
var area=""
if(that.data.hx_index!=-1){
area+=that.data.Provinces[that.data.hx_index].ProvinceName
}
if(that.data.hx_index0!=-1){
area+=that.data.Citys[that.data.hx_index0].CityName
}
if(that.data.hx_index1!=-1){
area+=that.data.Countys[that.data.hx_index1].CountyName
}
that.setData({
contact:contact,
tel:tel,
area:area
})
}
var editaddress = wx.getStorageSync("editaddress")
if(editaddress){
var myaddress=JSON.parse(editaddress);
var id=myaddress.addressId
var contact=myaddress.contact
var tel=myaddress.tel
var Province=myaddress.Province
var City=myaddress.City
var County=myaddress.County
var detail=myaddress.detail
var IFIndex=parseInt(myaddress.IFIndex)
var index=-1
var index0=-1
var index1=-1
var provinces=that.data.Provinces
for(var i=0;i<provinces.length;i++){
if(provinces[i].ProvinceID==Province){
index=i;
var citys=provinces[i].City;
for(var j=0;j<citys.length;j++){
if(citys[j].CityID==City){
index0=j;
var countys=citys[j].County;
for(var k=0;k<countys.length;k++){
if(countys[k].CountyID==County){
index1=k;
break;
}
}
break;
}
}
break;
}
}
that.setData({
hx_index: index,
weixinaddresshidden:true,
savebutton:"保存"
})
var citys=(index==-1?[]:that.data.Provinces[index].City)
that.setData({
Citys:citys,
hx_index0: index0
})
var countys=(index0==-1?[]:that.data.Citys[index0].County)
that.setData({
Countys:countys,
hx_index1: index1
})
var area=""
if(that.data.hx_index!=-1){
area+=that.data.Provinces[that.data.hx_index].ProvinceName
}
if(that.data.hx_index0!=-1){
area+=that.data.Citys[that.data.hx_index0].CityName
}
if(that.data.hx_index1!=-1){
area+=that.data.Countys[that.data.hx_index1].CountyName
}
that.setData({
addressId:id,
contact:contact,
tel:tel,
detail:detail,
IFDefault:IFIndex,
area:area,
loadingHidden:true
})
wx.setNavigationBarTitle({
title: '修改收货地址'
})
}else{
that.setData({
loadingHidden:true
})
}
},getweixinaddress:function(e) {
that.setData({
weixinbutton:"请稍候..."
})
wx.getSetting({
success(res) {
if (!res.authSetting["scope.address"]) {
wx.authorize({
scope: 'scope.address',
success () {
that.addweixinaddress()
}
})
}else{
/*wx.showToast({
title: JSON.stringify(res.authSetting),
icon: "none",
duration: 20000
})*/
that.addweixinaddress()
}
}
})
},addweixinaddress:function() {
wx.chooseAddress({
success (res) {
var userName=res.userName
var postalCode=res.postalCode
var provinceName=res.provinceName
var cityName=res.cityName
var countyName=res.countyName
var detailInfo=res.detailInfo
var nationalCode=res.nationalCode
var telNumber=res.telNumber
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userName!=""&&provinceName!=""&&cityName!=""&&telNumber!=""){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"addweixinaddress",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
contact:userName,
tel:telNumber,
provinceName:provinceName,
cityName:cityName,
countyName:countyName,
detail:detailInfo,
IFIndex:1
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
app.globalData.IFRefreshmyaddress=1
that.setData({
weixinbutton:"一键获取微信收货地址"
})
wx.navigateBack({})
}else{
that.setData({
weixinbutton:"一键获取微信收货地址"
})
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},fail (res) {
wx.showToast({
title: JSON.stringify(res),
icon: "none",
duration: 3000
})
}
})
},onarea:function(e) {
that.setData({
sectionHidden:false
})
},ProvinceChange:function(e) {
var index=e.detail.value;
var citys=that.data.Provinces[index].City
that.setData({
hx_index: index,
hx_index0: -1,
hx_index1: -1,
Citys:citys
})
if(citys.length==0){
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName
})
}
},CityChange:function(e) {
var index=e.detail.value
var countys=that.data.Citys[index].County
that.setData({
hx_index0: index,
hx_index1: -1,
Countys:countys
})
if(countys.length==0){
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName+that.data.Citys[that.data.hx_index0].CityName
})
}
},CountyChange:function(e) {
that.setData({
hx_index1: e.detail.value
})
that.setData({
sectionHidden:true,
area:that.data.Provinces[that.data.hx_index].ProvinceName+that.data.Citys[that.data.hx_index0].CityName+that.data.Countys[that.data.hx_index1].CountyName
})
},closesection:function(e) {
that.setData({
sectionHidden:true
})
},insection:function(e) {
},changeisDefault:function(e) {
var ifdefault = (e.detail.value==true?1:0)
that.data.IFDefault=ifdefault
},saveaddress:function(e) {
var addressId=that.data.addressId
var contact = e.detail.value.contact
var tel=e.detail.value.tel
var Province=(that.data.hx_index==-1?"":that.data.Provinces[that.data.hx_index].ProvinceID)
var City=(that.data.hx_index0==-1?"":that.data.Citys[that.data.hx_index0].CityID)
var County=(that.data.hx_index1==-1?"":that.data.Countys[that.data.hx_index1].CountyID)
var detail=e.detail.value.detail
var IFIndex=that.data.IFDefault
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var b=true
if(contact==null || contact==""){
b=false
wx.showToast({
title: "收货人不能为空!",
icon: "none",
duration: 3000
})
}
if(b){
if(tel==null || tel==""){
b=false
wx.showToast({
title: "手机号码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.hx_index==-1){
b=false
wx.showToast({
title: "省份必须选择!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(that.data.hx_index0==-1){
b=false
wx.showToast({
title: "城市必须选择!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(detail==null || detail==""){
b=false
wx.showToast({
title: "详细地址不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
that.setData({
savebutton:"请稍候..."
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:(addressId==0?"addAddress":"updateAddress"),
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
addressId:(addressId==0?"":addressId),
contact:contact,
tel:tel,
Province:Province,
City:City,
County:County,
detail:detail,
IFIndex:IFIndex
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
app.globalData.IFRefreshmyaddress=1
wx.showModal({
title: "操作提示",
content: res.data.msg,
showCancel:false,
success (res0) {
if (res0.confirm) {
that.setData({
savebutton:"保存"
})
wx.navigateBack({})
}
}
})
}else{
that.setData({
savebutton:"保存"
})
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "添加新地址"
}

View File

@@ -0,0 +1,83 @@
<view class="container">
<view class="fromtitle" bindtap="getweixinaddress" hidden="{{weixinaddresshidden}}"><image src="../../images/weixin.png"></image><text>{{weixinbutton}}</text><image class="arrowdown" src="../../images/icon-arrowdown.png"></image></view>
<view class="myaddress-box">
<view class="frombody">
<form bindsubmit='saveaddress'>
<view>
<text>收货人:</text><input name="contact" type="text" placeholder="请填写收货人地址" value="{{contact}}" />
</view>
<view>
<text>手机号码:</text><input name="tel" type="text" placeholder="请填写手机号码" value="{{tel}}" />
</view>
<view class="area" bindtap="onarea">
<text>所在地区:</text><input name="area" type="text" disabled="disabled" placeholder="请选择地区" value="{{area}}"/><image src="../../images/icon-arrowdown.png"></image>
</view>
<view>
<text>详细地址:</text><input name="detail" type="text" placeholder="请填写街道、楼牌号等" value="{{detail}}" />
</view>
<view>
<text>设为默认地址:</text>
<switch checked='{{IFDefault}}' color="#00B050" bindchange="changeisDefault"></switch>
</view>
<view class="button">
<button form-type="submit">{{savebutton}}</button>
</view>
</form>
</view>
</view>
<view class="Hidden_box" hidden="{{sectionHidden}}" bindtap="closesection">
<view class="section" catchtap="insection">
<view class="section-title">省市区选择器</view>
<view class="close" bindtap="closesection"><image src="../../images/close.png" /></view>
<view class="section-body">
<view>
<text>省份:</text>
<picker class="picker_hx" name="picker_hx" value="{{Provinces[hx_index].ProvinceID}}" data-selecthx="{{Provinces[hx_index].ProvinceName}}" range="{{Provinces}}" range-key="{{'ProvinceName'}}" bindchange="ProvinceChange">
<view class="picker">
<text hidden='{{Provinces[hx_index].ProvinceName==null}}'>{{Provinces[hx_index].ProvinceName}}</text>
<text hidden='{{Provinces[hx_index].ProvinceName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>城市:</text>
<picker class="picker_hx" name="picker_hx" value="{{Citys[hx_index0].CityID}}" data-selecthx="{{Citys[hx_index0].CityName}}" range="{{Citys}}" range-key="{{'CityName'}}" bindchange="CityChange">
<view class="picker">
<text hidden='{{Citys[hx_index0].CityName==null}}'>{{Citys[hx_index0].CityName}}</text>
<text hidden='{{Citys[hx_index0].CityName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
<view>
<text>县区:</text>
<picker class="picker_hx" name="picker_hx" value="{{Countys[hx_index1].CountyID}}" data-selecthx="{{Countys[hx_index1].CountyName}}" range="{{Countys}}" range-key="{{'CountyName'}}" bindchange="CountyChange">
<view class="picker">
<text hidden='{{Countys[hx_index1].CountyName==null}}'>{{Countys[hx_index1].CountyName}}</text>
<text hidden='{{Countys[hx_index1].CountyName!=null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view>
</picker>
</view>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,48 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.container .address-image {
width: 120px;
height: 120px;
}
.addaddress{position: fixed; bottom:1em; width:90%;}
.addaddress button{width:100%;height:2.5em; line-height: 2.5em; background-color:#fd463e;color:#fff; border-radius:0.5em;}
.myaddress-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%; padding:0.8em; box-sizing: border-box;}
.myaddress-item{width:100%; margin-bottom:0.8em; padding:0.8em; box-sizing: border-box;border:1px solid #f1f1f1; background-color:#fff;border-radius:0.5em;}
.myaddress-contact{width:100%;}
.myaddress-bottom{width:100%;margin-top:0.5em; display: flex;flex-direction: row; align-items: center;justify-content: center;}
.myaddress-bottom .myaddress-btn{width:100%;}
.myaddress-bottom .myaddress-btn image{width:1.2em;height:1.2em; vertical-align: middle;}
.fromtitle{width:100%; background-color:#fff; padding:1em; box-sizing: border-box;}
.fromtitle text{float:left;}
.fromtitle image{float:left;width:1.2em; height:1.2em;}
.fromtitle image.arrowdown{float:right; }
.myaddress-box .frombody{margin-top: 1em; padding:0.5em 1em;width:100%; display: flex;border-radius:0.5em;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.myaddress-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.myaddress-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em;}
.myaddress-box .frombody view.area input{width:12.8em;}
.myaddress-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
.myaddress-box .frombody view.button{border: 0;}
.myaddress-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
.section{position: relative; bottom:0; width:90%; height:20em; padding: 0 1em; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.section .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.section .close image{width:100%;height:100%;}
.section-title{width:100%;height:2.5em; line-height: 2.5em; text-align: center; font-weight: 600;border-bottom:1px solid #f1f1f1;}
.section-body{width:100%;}
.section-body view{width:100%;display: flex;flex-direction: row; align-items: center;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height:1.5em;}
.section-body view text{color:#000;}
.section-body view .picker_hx{color:#939393;line-height:2.5em;}
.section-body view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:10em; padding-left:1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;line-height:2em;}
.section-body view .picker_hx image{position: absolute; top:1em;right:0.6em; width:1.2em;height:1.2em;}

238
pages/mybalance/index.js Normal file
View File

@@ -0,0 +1,238 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
balanceImg: '../../images/order-null.png',
tipWords: '亲,暂时没有数据哦!',
balanceHidden:false,
nobalanceHidden:true,
loadingHidden:false,
mybalance:[],
Start: 0,
ZZEnable:1,
TXEnable:0,
nav:0,
},
onLoad: function(options) {
that = this
if(options.t){
that.setData({
nav:options.t
});
}
if(that.data.nav==1){
wx.setNavigationBarTitle({
title: "余额明细"
})
}else if(that.data.nav==2){
wx.setNavigationBarTitle({
title: "兑换积分明细"
})
}else if(that.data.nav==3){
wx.setNavigationBarTitle({
title: "贡献值明细"
})
}
else if(that.data.nav==4){
wx.setNavigationBarTitle({
title: "佣金明细"
})
}else if(that.data.nav==5){
wx.setNavigationBarTitle({
title: "活力值明细"
})
}else if(that.data.nav==9){
wx.setNavigationBarTitle({
title: "增值额度明细"
})
}else if(that.data.nav==15){
wx.setNavigationBarTitle({
title: "货款扣税明细"
})
}else if(that.data.nav==16){
wx.setNavigationBarTitle({
title: "冻结货款明细"
})
}else if(that.data.nav==17){
wx.setNavigationBarTitle({
title: "解冻货款明细"
})
}else if(that.data.nav==18){
wx.setNavigationBarTitle({
title: "广告值明细"
})
}else if(that.data.nav==19){
wx.setNavigationBarTitle({
title: "增值积分明细"
})
}else if(that.data.nav==21){
wx.setNavigationBarTitle({
title: "激活码明细"
})
}else if(that.data.nav==22){
wx.setNavigationBarTitle({
title: "推广名额明细"
})
}else if(that.data.nav==26){
wx.setNavigationBarTitle({
title: "补贴券明细"
})
}else{
wx.setNavigationBarTitle({
title: "重复消费明细"
})
}
sopenFrame=setInterval(function (){
if(app.globalData.IFRefreshmybalance==1){
app.globalData.IFRefreshmybalance=0
that.clearCache();//清本页缓存
that.getlist(0)
}
}, 1000);
that.clearCache();//清本页缓存
that.getlist(0)
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
if(that.data.loadingHidden){
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
}else{
wx.hideLoading();
}
},
// 清缓存
clearCache:function(){
that.setData({
balanceHidden:false,
nobalanceHidden:true,
loadingHidden:false,
Start: 0,
mybalance:[]
});
},getlist: function(gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId&&userInfodata){
var userInfo = JSON.parse(userInfodata)
that.setData({
ZZEnable:userInfo.ZZEnable,
TXEnable:userInfo.TXEnable,
})
}
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx?timestamp=" + (new Date().getTime() / 1000),
data: {
action:"getbilllist",
t:that.data.nav,
Start:that.data.Start,
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
tmpArr = that.data.mybalance;
tmpArr.push.apply(tmpArr,res.data.data);
that.setData({
mybalance: tmpArr,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
if(gp==0||gp==1){
if(res.data.data.length>0){
that.setData({
balanceHidden:false,
nobalanceHidden:true
})
}else{
that.setData({
balanceHidden:true,
nobalanceHidden:false
})
}
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},onnav:function(e) {
var index = e.currentTarget.dataset.id
that.setData({
nav:index
})
that.clearCache();
that.getlist(0);
},onzz:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(!userId||!LoginId){
wx.navigateTo({
url: "../login/index"
})
}else{
wx.navigateTo({
url: "../zhuanzhang/index?t=" + that.data.nav
})
}
},ontx:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(!userId||!LoginId){
wx.navigateTo({
url: "../login/index"
})
}else{
wx.navigateTo({
url: "../withdrawal/index?t=0"
})
}
},onzh:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(!userId||!LoginId){
wx.navigateTo({
url: "../login/index"
})
}else{
wx.navigateTo({
url: "../zhuanhuan/index?t=1"
})
}
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "明细"
}

View File

@@ -0,0 +1,43 @@
<view class="container">
<view class="button_box" wx:if="{{nav==1&&TXEnable==0}}">
<view class="button_box_item" style="width:100%" wx:if="{{nav==11&&mybalance.length>0}}">
<view class="mybtn" bindtap="onzz">互转</view>
</view>
<view class="button_box_item" wx:if="{{nav==11&&mybalance.length>0}}">
<view class="mybtn" bindtap="onzz">互转</view>
</view>
<view class="button_box_item" wx:if="{{nav==1&&mybalance.length>0}}">
<view class="mybtn" bindtap="ontx">提现</view>
</view>
<view class="button_box_item" style="width:100%" wx:if="{{nav==2&&mybalance.length>0}}">
<view class="mybtn" bindtap="onzh">划转流量积分</view>
</view>
</view>
<view class="mybalance-box" hidden="{{balanceHidden}}">
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index" >
<view class="Total">
<view><text>增减:</text>{{item.Addmoney}}</view>
<view class="right"><text>余额:</text>{{item.Totalmoney}}</view>
</view>
<view>
<text>时间:</text>{{item.addtime}}
</view>
<view>
<text>备注:</text>{{item.BZContent}}
</view>
</view>
</view>
<view class="nodata" hidden="{{nobalanceHidden}}">
<image src="../../images/order-null.png"/>
<view>暂无数据</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,67 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.container .balance-image {
width: 80px;
height: 80px;
}
.button_box{
display: flex;
flex-direction: row;
margin: 0;
padding:0;
padding-right: 0.8em;
box-sizing: border-box;
align-items: center;
justify-content: center;
background-color: #fff;
}
.button_box .button_box_item{
display: flex;
flex-direction: column;
flex-grow: 1;
width:50%;
height:2.5em;
margin: 0;
padding: 0.8em;
padding-right: 0;
}
.button_box .button_box_item .mybtn{
width: 100%;
height: 100%;
border-radius: 0.4em;
background-color: #00B050;
color:#fff;
line-height: 2.5em;
text-align: center;
}
.mybalance-menu{display: flex;flex-direction: row;align-items: center;justify-content: center;width:100%; background-color: #fff;}
.mybalance-menu view{width:25%; height:2.5em; line-height: 2.5em; text-align: center; border:1px solid #f1f1f1; border-left:0;border-top: 0;}
.mybalance-menu view.hover{border-bottom:1px solid #ff4d00;}
.mybalance-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;padding:0.8em; box-sizing: border-box;}
.mybalance-item{width:100%;display: flex;flex-direction: column; align-items: center;justify-content: center;box-sizing: border-box; padding:0.5em 0.8em; margin:0.8em 0; margin-top: 0; line-height: 2em; background-color:#fff;border-radius:0.5em;}
.mybalance-item view{width:100%;display: flex;flex-direction: row; align-items: center;justify-content:left;color: #939393;}
.mybalance-item view text{color: #000;}
.mybalance-item view text.Totalprice{ margin-left: 1em;}
.mybalance-item view.Total{float: left; display: block;}
.mybalance-item view.Total view{float: left; display: block;width:auto; margin:0; padding:0;color:#ff4d00; box-sizing: border-box; overflow: hidden;}
.mybalance-item view.Total view.right{float:right;}
.mybalance-item view.Total view text{float: left; display: block;width:auto;color: #000;}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

497
pages/mybankdata/index.js Normal file
View File

@@ -0,0 +1,497 @@
var app = getApp()
var that=null
var sopenFrame=null
var wait=120
Page( {
data: {
loadingHidden:false,
AccountName:"",
BankName:"",
BankCard:"",
BankDepos:"",
BankNames:[],
AliAccount:"",
AliName:"",
aliimage:"../../images/add.png",
weixinimage:"../../images/add.png",
alipic:"",
weixinpic:"",
phone:"",
getcode:"获取验证码",
savebutton:"保存",
nav:0,
appbus:0,
index:-1,
umoney:0,
umoney0:0
},
onLoad: function(options) {
that = this
if(options.t){
that.setData({
nav:options.t
});
}
if(options.appbus){
that.setData({
appbus:options.appbus
});
}
that.rdata()
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.rdata();//第一次加载数据
},rdata: function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId&&userInfodata){
var userInfo = JSON.parse(userInfodata)
that.setData({
phone:userInfo.Phone,
umoney:userInfo.xjye,
umoney0:userInfo.zzjfye
})
if(userInfo.xjye>0||userInfo.zzjfye>0){
wx.setNavigationBarTitle({
title: "绑定收款账号"
})
}
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getuserinfo",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"GET",
dataType:"json",
success (res) {
if(res.data.status==1){
var accountname=res.data.user.accountname
var bankname=res.data.user.bankname
var bankcard=res.data.user.bankcard
var bankaddress=res.data.user.bankaddress
var webbank=res.data.webbank
var webbanks=webbank.split('|')
var banks=""
var index=0
for(var i=0;i<webbanks.length;i++){
if(banks!=""){
banks+=",{\"key\":\""+webbanks[i]+"\"}"
}else{
banks+="{\"key\":\""+webbanks[i]+"\"}"
}
if(webbanks[i]==bankname){
index=i;
}
}
that.setData({
index: index,
AccountName:accountname,
BankName:bankname,
BankCard:bankcard,
BankDepos:bankaddress,
BankNames:JSON.parse("["+banks+"]"),
AliAccount:res.data.user.AliAccount,
AliName:res.data.user.AliName,
aliimage:res.data.user.aliimage,
weixinimage:res.data.user.weixinimage,
loadingHidden:true
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},onnav:function(e) {
var index = e.currentTarget.dataset.id
that.setData({
nav:index
})
},onaliimage:function(e) {
var yimage=that.data.aliimage
if(that.data.aliimage=="../../images/ajaxLoader.gif"){
wx.showToast({
title: "正在上传中...",
icon: "none",
duration: 3000
})
}else{
wx.chooseImage({
count: 1,
sizeType: ['original'],
sourceType: ['album', 'camera'],
success (res) {
const tempFilePaths = res.tempFilePaths;
that.setData({
aliimage:"../../images/ajaxLoader.gif"
})
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.uploadFile({
url: app.globalData.apiurl + "/xapiajax.ashx", //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image',
formData: {
action:"uploadImage",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
fail: function(err) {
wx.showToast({
title: "上传出错了",
icon: "none",
duration: 2000
})
that.setData({
aliimage:yimage
})
},
success (res0){
var data=JSON.parse(res0.data);
if(data.status==1){
wx.showToast({
title: data.msg,
icon: "success",
duration: 1000
})
that.setData({
aliimage:data.url,
alipic:data.pic
})
}else{
wx.showToast({
title: data.msg,
icon: "none",
duration: 2000
})
that.setData({
aliimage:yimage
})
}
}
});
}
})
}
},onweixinimage:function(e) {
var yimage=that.data.weixinimage
if(that.data.weixinimage=="../../images/ajaxLoader.gif"){
wx.showToast({
title: "正在上传中...",
icon: "none",
duration: 3000
})
}else{
wx.chooseImage({
count: 1,
sizeType: ['original'],
sourceType: ['album', 'camera'],
success (res) {
const tempFilePaths = res.tempFilePaths;
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
that.setData({
weixinimage:"../../images/ajaxLoader.gif"
})
wx.uploadFile({
url: app.globalData.apiurl + "/xapiajax.ashx", //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image',
formData: {
action:"uploadImage",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
fail: function(err) {
wx.showToast({
title: "上传出错了",
icon: "none",
duration: 2000
})
that.setData({
weixinimage:yimage
})
},
success (res0){
var data=JSON.parse(res0.data);
if(data.status==1){
wx.showToast({
title: data.msg,
icon: "success",
duration: 1000
})
that.setData({
weixinimage:data.url,
weixinpic:data.pic
})
}else{
wx.showToast({
title: data.msg,
icon: "none",
duration: 2000
})
that.setData({
weixinimage:yimage
})
}
}
});
}
})
}
},getcode:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var b=true
if(b){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"sendphonecode1",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.gettime()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
},
gettime:function() {
if (wait == 0) {
that.setData({
getcode:"获取验证码"
})
wait = 120;
} else {
that.setData({
getcode: "重新发送(" + wait + ")"
})
wait--;
setTimeout(function() {
that.gettime()
}, 1000)
}
},BankChange:function(e) {
var index=e.detail.value;
var key=that.data.BankNames[index].key
that.setData({
index: index
})
},saveaddress:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var pwd = e.detail.value.txpwd
var b=true
var AccountName = ""
var BankName=""
var BankCard=""
var BankDepos=""
var AliAccount=""
var AliName=""
var aliimage=""
var weixinimage=""
if(that.data.nav==0){
AccountName = e.detail.value.AccountName
BankName=(that.data.index==-1?"":that.data.BankNames[that.data.index].key)
BankCard=e.detail.value.BankCard
BankDepos=e.detail.value.BankDepos
if(b){
if(AccountName==null || AccountName==""){
b=false
wx.showToast({
title: "开户姓名不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(BankName==null || BankName==""){
b=false
wx.showToast({
title: "银行名称必须选择!",
icon: "none",
duration: 3000
})
}
}
if(b){
if(BankCard==null || BankCard==""){
b=false
wx.showToast({
title: "开户姓名不能为空!",
icon: "none",
duration: 3000
})
}
}
}else if(that.data.nav==1){
AliAccount = e.detail.value.AliAccount
AliName = e.detail.value.AliName
if((AliAccount=="" || AliName=="") && that.data.aliipic==""){
b=false
wx.showToast({
title: "支付宝账号姓名和收款码必选一!",
icon: "none",
duration: 3000
})
}else if(that.data.aliimage=="../../images/ajaxLoader.gif"){
b=false
wx.showToast({
title: "支付宝收款码正在上传中!",
icon: "none",
duration: 3000
})
}else{
aliimage=that.data.alipic
}
}else if(that.data.nav==2){
if(that.data.weixinpic==""){
b=false
wx.showToast({
title: "微信收款码未上传!",
icon: "none",
duration: 3000
})
}else if(that.data.weixinimage=="../../images/ajaxLoader.gif"){
b=false
wx.showToast({
title: "微信收款码正在上传中!",
icon: "none",
duration: 3000
})
}else{
weixinimage=that.data.weixinpic
}
}
if(b){
if(pwd==null || pwd==""){
b=false
wx.showToast({
title: "安全密码不能为空!",
icon: "none",
duration: 3000
})
}
}
if(b){
that.setData({
savebutton:"请稍候..."
})
var datas={}
if(that.data.nav==0){
datas={
action:"updateBankInfo",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
AccountName:AccountName,
BankName:BankName,
BankCard:BankCard,
BankDepos:BankDepos,
pwd:pwd
}
}else if(that.data.nav==1){
datas={
action:"updatealipay",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
AliAccount:AliAccount,
AliName:AliName,
aliimage:aliimage,
pwd:pwd
}
}else if(that.data.nav==2){
datas={
action:"updateweixinpay",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
weixinimage:weixinimage,
pwd:pwd
}
}
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: datas,
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
wx.showModal({
title: "操作提示",
content: res.data.msg,
showCancel:false,
success (res0) {
if (res0.confirm) {
that.rdata();
}
}
})
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
that.setData({
savebutton:"保存"
})
}
})
}
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": ""
}

View File

@@ -0,0 +1,62 @@
<view class="container" wx:if="{{umoney>0||umoney0>0}}">
<view class="myorder-menu">
<view class='{{nav==0?"hover":""}}' bindtap="onnav" data-id="0">银行账号</view>
<view class='{{nav==1?"hover":""}}' bindtap="onnav" data-id="1">支付宝</view>
<view class='{{nav==2?"hover":""}}' bindtap="onnav" data-id="2">微信支付</view>
</view>
<view class="mydata-box">
<view class="frombody">
<form bindsubmit='saveaddress'>
<view wx:if="{{nav==0}}">
<text>开户姓名:</text><input name="AccountName" type="text" placeholder="请填写您的开户姓名" value="{{AccountName}}" />
</view>
<view wx:if="{{nav==0}}" class="area" bindtap="onarea">
<text>银行名称:</text>
<picker class="picker_hx" name="picker_hx" value="{{BankNames[index].key}}" data-selecthx="{{BankNames[index].key}}" range="{{BankNames}}" range-key="{{'key'}}" bindchange="BankChange"> <view class="picker">
<text wx:if='{{BankNames[index]!=null}}'>{{BankNames[index].key}}</text>
<text wx:if='{{BankNames[index]==null}}'>==请选择==</text>
<image src="../../images/icon-arrowdown1.png"></image>
</view></picker>
</view>
<view wx:if="{{nav==0}}">
<text>银行卡号:</text><input name="BankCard" type="text" placeholder="请填写银行卡号" value="{{BankCard}}" />
</view>
<view wx:if="{{nav==0}}">
<text>开户行:</text><input name="BankDepos" type="text" placeholder="请填写开户行地址" value="{{BankDepos}}" />
</view>
<view wx:if="{{nav==1}}">
<text>支付宝账号:</text><input name="AliAccount" type="text" placeholder="请填写支付宝账号" value="{{AliAccount}}" />
</view>
<view wx:if="{{nav==1}}">
<text>支付宝姓名:</text><input name="AliName" type="text" placeholder="请填写支付宝账号" value="{{AliName}}" />
</view>
<view wx:if="{{nav==1}}">
<text style="width: 7em;">支付宝收款码:</text>
<view class="payimage" bindtap="onaliimage"><image src='{{aliimage}}'></image></view>
</view>
<view wx:if="{{nav==2}}">
<text style="width: 7em;">微信收款码:</text>
<view class="payimage" bindtap="onweixinimage"><image src='{{weixinimage}}'></image></view>
</view>
<view>
<text>安全密码:</text><input name="txpwd" type="text" value="" placeholder="请填写您的安全密码" type="password" />
</view>
<view class="button">
<button form-type="submit">{{savebutton}}</button>
</view>
</form>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -0,0 +1,39 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.myorder-menu{display: flex;flex-direction: row;align-items: center;justify-content: center;width:100%; background-color: #fff;}
.myorder-menu view{display: flex;flex: 1; height:2.5em; line-height: 2.5em; text-align: center; border:1px solid #f1f1f1; border-left:0;border-top: 0; align-items: center;justify-content: center;}
.myorder-menu view.hover{border-bottom:1px solid #00B050;color:#00B050;}
.mydata-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%; padding: 0 0.8em; box-sizing: border-box;}
.mydata-box .frombody{margin-top: 1em; padding:0.5em 1em;width:100%; display: flex;border-radius:0.5em; flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
.mydata-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box;}
.mydata-box .frombody view view{display: block; width: auto;padding:0; border-bottom:0;line-height: 2.5em;}
.mydata-box .frombody view text{float:left; display: block; padding:0; width:6em; height:2.5em; line-height: 2.5em;}
.mydata-box .frombody view input{float:left; width:14em;height:2.5em; line-height: 2.5em;}
.mydata-box .frombody view input.code{width:9em;}
.mydata-box .frombody view.button{border: 0;}
.mydata-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
.mydata-box .frombody view .picker_hx{color:#939393;line-height:2.5em;}
.mydata-box .frombody view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:14em; padding:0 1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;height:2.5em;line-height:2.5em;}
.mydata-box .frombody view .picker_hx image{position: absolute; top:0.6em;right:0.6em; width:1.2em;height:1.2em;}
.mydata-box .frombody view .payimage{
width: 4em;
height: 4em;
border:1px solid #f1f1f1;
box-sizing: border-box;
}
.mydata-box .frombody view .payimage image{
width: 100%;
height: 100%;
}

121
pages/mybonus/index.js Normal file
View File

@@ -0,0 +1,121 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
bonusImg: '../../images/iconfont-dingdan.png',
tipWords: '亲,暂时没有数据哦!',
bonusHidden:false,
nobonusHidden:true,
loadingHidden:false,
mybonus:[],
Start: 0,
nav:0,
title:""
},
onLoad: function(options) {
that = this;
var t=options.t;
that.setData({
nav: t
})
that.clearCache();//清本页缓存
that.getlist(0)
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
bonusHidden:false,
nobonusHidden:true,
loadingHidden:false,
Start: 0,
mybonus:[]
});
},getlist: function(gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getjianjinlist",
t:that.data.nav,
Start:that.data.Start,
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
tmpArr = that.data.mybonus;
tmpArr.push.apply(tmpArr,res.data.data);
that.setData({
mybonus: tmpArr,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
if(gp==0||gp==1){
var title=res.data.categorys[(that.data.nav-1)].title;
that.setData({
title:title
})
wx.setNavigationBarTitle({
title: title
})
if(res.data.data.length>0){
that.setData({
bonusHidden:false,
nobonusHidden:true
})
}else{
that.setData({
bonusHidden:true,
nobonusHidden:false
})
}
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
},onbonus:function(e) {
var data = e.currentTarget.dataset.id
wx.navigateTo({
url: "../mybonus0/index?" + data
})
}
})

3
pages/mybonus/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": ""
}

26
pages/mybonus/index.wxml Normal file
View File

@@ -0,0 +1,26 @@
<view class="container">
<view class="mybonus-box" hidden="{{bonusHidden}}">
<view class="mybonus-item mybonus-title">
<text class="time">日期</text>
<text class="je">{{title}}</text>
<view></view>
</view>
<block wx:for="{{mybonus}}" wx:for-index="index">
<view class="mybonus-item" bindtap="onbonus" data-id="t={{nav}}&addtime={{item.addtime}}">
<text class="time">{{item.addtime}}</text>
<text class="je">{{(nav==1?item.b1:(nav==2?item.b2:(nav==3?item.b3:(nav==4?item.b4:(nav==5?item.b5:(nav==6?item.b6:item.b7))))))}}</text>
<view><image src="../../images/faifeito.png"></image></view>
</view>
</block>
</view>
<view class="nodata-box" hidden="{{nobonusHidden}}">
<image src="{{bonusImg}}" class="bonus-image"/>
<view>{{tipWords}}</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

23
pages/mybonus/index.wxss Normal file
View File

@@ -0,0 +1,23 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
font-size: 14px;
color: #000;
}
.container .bonus-image {
width: 80px;
height: 80px;
}
.nodata-box{display: flex;flex-direction: column;align-items: center;justify-content: center;}
.mybonus-box{width:100%; overflow:hidden;padding:0.8em; box-sizing: border-box;}
.mybonus-item{width:100%;display: flex;flex-direction: row; box-sizing: border-box; padding:0; margin-bottom:0.8em; background-color:#fff; border-radius:0.5em; box-sizing:border-box;overflow:hidden;}
.mybonus-item.mybonus-title{background: linear-gradient(to bottom,#f2f2f2,#dbd8d8);}
.mybonus-item text{display: flex; padding:0 0.5em; height:3em; line-height: 3em; box-sizing: border-box; overflow: hidden; color: #939393;/*border: 1px solid #f1f1f1;border-left:0; border-top:0;*/ text-align: center;align-items: center;justify-content: center;}
.mybonus-item text.time{width:10em}
.mybonus-item text.je{flex-grow: 1; border-right:0;}
.mybonus-item view{width:1.2em;}
.mybonus-item view image{margin-top:0.8em; width:1.2em; height:1.2em; }

121
pages/mybonus0/index.js Normal file
View File

@@ -0,0 +1,121 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
bonusImg: '../../images/iconfont-dingdan.png',
tipWords: '亲,暂时没有数据哦!',
bonusHidden:false,
nobonusHidden:true,
loadingHidden:false,
title:"",
mybonus:[],
Start: 0,
nav:0,
addtime:""
},
onLoad: function(options) {
that = this
that.setData({
nav: options.t,
addtime:options.addtime
})
wx.setNavigationBarTitle({
title: options.addtime + "的奖励详情"
})
that.clearCache();//清本页缓存
that.getlist(0)
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
bonusHidden:false,
nobonusHidden:true,
loadingHidden:false,
Start: 0,
mybonus:[]
});
},getlist: function(gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getjianjinlist0",
t:that.data.nav,
addtime:that.data.addtime,
Start:that.data.Start,
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
tmpArr = that.data.mybonus;
tmpArr.push.apply(tmpArr,res.data.data);
that.setData({
categorys:res.data.categorys,
mybonus: tmpArr,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
if(gp==0||gp==1){
var title=res.data.categorys[(that.data.nav-1)].title;
that.setData({
title:title
})
wx.setNavigationBarTitle({
title: that.data.addtime + title
})
if(res.data.data.length>0){
that.setData({
bonusHidden:false,
nobonusHidden:true
})
}else{
that.setData({
bonusHidden:true,
nobonusHidden:false
})
}
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "积分详情"
}

26
pages/mybonus0/index.wxml Normal file
View File

@@ -0,0 +1,26 @@
<view class="container">
<view class="mybonus-box" hidden="{{bonusHidden}}">
<view class="mybonus-item mybonus-title">
<text class="time">时间</text>
<text>{{title}}</text>
<text class="bz">备注</text>
</view>
<block wx:for="{{mybonus}}" wx:for-index="index">
<view class="mybonus-item">
<text class="time">{{item.addtime}}</text>
<text>{{(nav==1?item.b1:(nav==2?item.b2:(nav==3?item.b3:(nav==4?item.b4:(nav==5?item.b5:(nav==6?item.b6:item.b7))))))}}</text>
<text class="bz">{{item.conent}}</text>
</view>
</block>
</view>
<view class="nodata-box" hidden="{{nobonusHidden}}">
<image src="{{bonusImg}}" class="bonus-image"/>
<view>{{tipWords}}</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

23
pages/mybonus0/index.wxss Normal file
View File

@@ -0,0 +1,23 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
font-size: 14px;
color: #000;
}
.container .bonus-image {
width: 80px;
height: 80px;
}
.nodata-box{display: flex;flex-direction: column;align-items: center;justify-content: center;}
.mybonus-box{width:100%;}
.mybonus-item{width:100%;float:left; display: block;box-sizing: border-box; padding:0; margin:0; margin-top: 0; background-color:#fff; border-left:1px solid #f1f1f1; border-top:1px solid #f1f1f1; box-sizing:border-box;}
.mybonus-item.mybonus-title{background: linear-gradient(to bottom,#f2f2f2,#dbd8d8);}
.mybonus-item text{float:left; display: block;padding:0 0.5em; width:20%; height:2.5em; line-height: 2.5em; box-sizing: border-box; overflow: hidden; color: #939393; text-align: center;border: 1px solid #f1f1f1;border-left:0; border-top:0;}
/*.mybonus-item text.time{width:8%;}
.mybonus-item text.time0{width:8%;color:#124e99}
.mybonus-item text.zt{width:8%;}*/
.mybonus-item text.bz{width:60%;}

310
pages/mybusiness/index.js Normal file
View File

@@ -0,0 +1,310 @@
var app = getApp()
var that=null
var sopenFrame=null
var mCanvas
Page( {
data: {
loadingHidden:false,
ewmpic:"",
width:300,
height:400,
sjylmoney: 0,
smzemoney: 0,
zsymoney: 0,
jrmoney:0,
zrmoney:0,
IFDefault:false,
savetitle:"保存商家收款码到相册"
},
onLoad: function() {
that = this
that.rdata()
}, // 下拉刷新
onPullDownRefresh: function () {
that.rdata()
},rdata: function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
var userInfo = JSON.parse(userInfodata)
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getmybusinessdata",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId)
},
method:"GET",
dataType:"json",
success (res) {
if(res.data.status==1){
that.setData({
sjylmoney: res.data.sjylmoney,
smzemoney: res.data.smzemoney,
zsymoney: res.data.zsymoney,
jrmoney:res.data.jrmoney,
zrmoney:res.data.zrmoney,
IFDefault:(res.data.userInfo.Paypush==1?true:false),
width:300,
height:400,
loadingHidden:true
})
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec((res0) => {
let textCanvas = res0[0].node; // 重点1
mCanvas=textCanvas
let textCtx = textCanvas.getContext('2d'); // 重点2
const dpr = wx.getSystemInfoSync().pixelRatio
var w=res0[0].width
var h=res0[0].height
textCanvas.width = w * dpr
textCanvas.height = h * dpr
textCtx.scale(dpr, dpr)
textCtx.clearRect(0,0,textCanvas.width,textCanvas.height)
textCtx.beginPath();
//绘制背景
textCtx.fillStyle = '#fff'
textCtx.clearRect(0,0, textCanvas.width, textCanvas.height)
textCtx.fillRect(0, 0, textCanvas.width, textCanvas.height)
const bg = textCanvas.createImage();
bg.src = '../../images/skm.png';
bg.onload = () => {
textCtx.drawImage(bg, 0, 0, w, h)
let text1 = res.data.sjname
let len=((w-text1.length*20)/2)
textCtx.fillStyle = "#000";
textCtx.font = "22px Arial";
textCtx.fontWeight = 'bold'
//textCtx.textAlign = 'center'
that.getWarpText(textCtx, text1, len, 100, w, 52, 1)
if(res.data.ewmpic!=""){
const bg0 = textCanvas.createImage();
bg0.src = res.data.ewmpic;
bg0.onload = () => {
textCtx.drawImage(bg0, ((w-145)/2), 130, 145, 145)
}
}
}
})
}else{
}
}
})
},onxz: function(e) {
that.setData({
savetitle:"保存中,请稍候..."
})
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.canvasToTempFilePath({
canvasId: "myCanvas",
destWidth: 520,
destHeight: 720,
canvas: mCanvas,
success: function(res0) {
// 获取图片路径
const tempFilePath = res0.tempFilePath;
wx.saveImageToPhotosAlbum({
filePath: tempFilePath,
success(res) {
console.log(res);
wx.showModal({
title: '图片保存成功',
content: '图片成功保存到相册了,去发圈噻~',
showCancel: false,
confirmText: '好哒',
confirmColor: '#72B9C3',
success: function (res0) {
if (res0.confirm) {
}
that.setData({
QRcodeHidden: true,
savetitle:"保存商家收款码到相册"
})
}
})
}
})
},
fail: function(err) {
wx.showToast({
title: err,
icon: "none",
duration: 10000
})
}
})
},onsmlog: function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId&&userInfodata){
var t = e.currentTarget.dataset.id
wx.navigateTo({
url: "../mybusiness_smlog/index?t=" + t
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},onzzlog:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(!userId||!LoginId){
wx.navigateTo({
url: "../login/index"
})
}else{
wx.navigateTo({
url: "../zzjf_log/index"
})
}
},changeisDefault:function(e) {
var t = (e.detail.value==true?1:0)
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"updatePaypush",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
t:t
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
that.rdata()
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
},onsjzl:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(!userId||!LoginId){
wx.navigateTo({
url: "../login/index"
})
}else{
wx.navigateTo({
url: "../mybusiness_info/index"
})
}
},onsylog: function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId&&userInfodata){
wx.navigateTo({
url: "../zzjf_sylog/index?t=5"
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},getWarpTextMulti:function(canvas, arrText, y, gap = 10) {
for (let index = 0; index < arrText.length; index++) {
const text = arrText[index];
let lineArr = getWarpText(canvas, text, MARGIN_LEFT, y, MAX_WIDTH, LINE_HEIGHT)
y += LINE_HEIGHT * lineArr.length + gap
}
},getWarpText:function(canvas, text, x, y, maxWidth, lineHeight, maxLine) {
// 对入参的类型进行检测
if (typeof text != 'string' || typeof x != 'number' || typeof y != 'number' || typeof lineHeight != 'number') {
throw new Error("参数传入出错")
}
//如果最大宽度未定义 默认为canvas宽度
if (typeof maxWidth == 'undefined') {
maxWidth = (canvas && canvas.width);
}
if (typeof lineHeight == 'undefined') {
lineHeight = (canvas.canvas && parseInt(window.getComputedStyle(canvas.canvas).lineHeight)) ||
parseInt(window.getComputedStyle(document.body).lineHeight)
}
let arrText = text.split('');
let line = '';
let lines = [];
let lastLine = ""
let ellipsis = canvas.measureText("...");
let ellipsisWidth = ellipsis.width;
for (let n = 0; n < arrText.length; n++) {
//每个循环累加字符
let testLine = line + arrText[n];
//检测累加字符 获取累加字符的高度和宽度
let metrics = canvas.measureText(testLine);
let testWidth = metrics.width;
let lineWidth = canvas.measureText(line).width;
// 如果当前添加行是最后一行 则替换最后一个字符为"..." 判断长度是否需要删去最后一个字符
if (maxLine && maxLine - 1 === lines.length && ((lineWidth + ellipsisWidth) > maxWidth)) {
line = line.slice(0, line.length - 1) + "...";
testWidth = lineWidth + ellipsisWidth;
}
//如果累加字符的宽度大于定义的绘制文本最大宽度 则绘制累加字符的文本 并且设置换行间距再次进行绘制
if (testWidth > maxWidth && n > 0) {
lastLine = line;
lines.push({
text: line,
x: x,
y: y
})
if (maxLine && maxLine <= lines.length) {
break
}
line = arrText[n];
y += lineHeight;
} else {
line = testLine;
}
}
if (lastLine !== line) {
lines.push({
text: line,
x: x,
y: y
})
}
for (let i = 0; i < lines.length; i++) {
const item = lines[i];
canvas.fillText(item.text, item.x, item.y);
}
return lines;
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "联盟商家管理"
}

View File

@@ -0,0 +1,64 @@
<view class="container">
<view class="emx_box">
<view>
<canvas type="2d" canvas-id="myCanvas" id="myCanvas" style="width: 100vw; height: 130vw;"></canvas>
</view>
<view class="button_box">
<view class="button_box_item" style="width:100%">
<view class="mybtn" bindtap="onxz">{{savetitle}}</view>
</view>
</view>
</view>
<view class="emx_button_box">
<view class="zzjfmx_box">
<view class="Paypush_box">
<text>开启/关闭收款自动播报:</text>
<switch checked='{{IFDefault}}' color="#00B050" bindchange="changeisDefault"></switch>
</view>
<view class="gxzmx_box">
<view bindtap="onsmlog" data-id="0" class="alink">
<text>扫码总额</text>
<text class="je">{{smzemoney}}</text>
</view>
<view bindtap="onsmlog" data-id="1" class="alink">
<text>今日金额</text>
<text class="je">{{jrmoney}}</text>
</view>
<view bindtap="onsmlog" data-id="2" class="alink">
<text>昨日金额</text>
<text class="je">{{zrmoney}}</text>
</view>
</view>
<view class="gxzmx_box">
<view>
<text>商家让利</text>
<text class="je">{{sjylmoney}}%</text>
</view>
<view bindtap="onzzlog" class="alink">
<text>增值积分</text>
<text class="je">{{zsymoney}}</text>
</view>
<view bindtap="onsjzl" class="alink">
<text>查看商家资料</text>
</view>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

168
pages/mybusiness/index.wxss Normal file
View File

@@ -0,0 +1,168 @@
page{
background: #ccc;
}
.container {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
width: 100%;
height: 100%;
padding: 0;
font-size: 14px;
color: #000;
}
.footer{
position: fixed;
z-index: 10000;
bottom:0;
left:0;
width: 100%;
text-align: center;
padding: 0;
}
.footer button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff;border-radius:0;}
.emx_box{
display: flex;flex-direction: column;width:100%; box-sizing: border-box; border-radius:0.5em;
}
.emx_box_to{
width:100%;
background-color: #fff;
}
.Canvas_box_to{
display: none;
}
.Canvas_box_to canvas{
width:100%;
}
.emx_box_to image{
width:100%;
}
.emx_button_box{
display: flex;flex-direction: column;width:100%; padding: 0.8em; box-sizing: border-box; border-radius:0.5em;
}
.button_box{
display: flex;
flex-direction: row;
margin: 0;
padding:0;
padding-right: 0.8em;
width: 100%;
box-sizing: border-box;
align-items: center;
justify-content: center;
background-color: #fff;
border-radius:0.5em;
}
.button_box form{
width: 100%;
}
.button_box .button_box_to{
display: flex;
flex-direction: row;
width: 100%;
}
.button_box .button_box_item{
display: flex;
flex-direction: column;
flex-grow: 1;
width:50%;
height:2.5em;
margin: 0;
padding: 0.8em;
padding-right: 0;
}
.button_box .button_box_item .mybtn{
width: 100%;
height: 100%;
border-radius: 0.4em;
background-color: #00B050;
color:#fff;
line-height: 2.5em;
text-align: center;
font-size: 1em;
}
.gxzmx_box {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
background-color: #fff;
margin: 0;
padding: 0em;
text-align: center;
border-radius: 0.7em 0.7em 0 0;
border-bottom: 1px solid #f1f1f1;
box-sizing: border-box;
}
.gxzmx_box view {
display: flex;
flex-direction: column;
width: 50%;
align-items: center;
justify-items: center;
padding-top: 1.2em;
padding-bottom: 1.2em;
box-sizing: border-box;
}
.gxzmx_box view image {
display: block;
width:3em;
height:3em;
}
.gxzmx_box view text {
display: block;
color: #000;
font-size: 1em;
}
.gxzmx_box view text.je {
color: #000;
font-weight: 800;
}
.gxzmx_box view.alink text{
color:#00B050;
}
.Paypush_box{
display: flex;
flex-direction:row;
align-items: center;
width: 100%;
padding: 0.8em;
border-bottom:1px solid #f1f1f1;
box-sizing: border-box;
}
.zzjfmx_box {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
background-color: #fff;
margin: 0;
margin-top: 0.8em;
padding: 0em;
text-align: center;
border-radius: 0.5em;
overflow: hidden;
box-sizing: border-box;
}
.zzjfmx_box .title {
width: 100%;
height: 2.5em;
line-height: 2.5em;
font-size: 1em;
text-align: left;
border-bottom: 1px solid #f1f1f1;
padding: 0 0.8em;
box-sizing: border-box;
font-size: 1em;
font-weight: 900;
}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}

Some files were not shown because too many files have changed in this diff Show More