Commit 49948a24 authored by 石盼盼's avatar 石盼盼

1

parent 8dd1fee2
......@@ -127,7 +127,7 @@ App({
data: {
code: code,
app_type: 'repair',
authorizer_appid: "wx4c343d3425b433cc"
authorizer_appid: "wxafaf02db6f71f4a3"
},
success: function (res) {
if (res.data.code === 200) {
......
{
"pages":[
"pages/translate/translate"
"pages/translate/translate",
"pages/quickPay/login/login",
"pages/quickPay/confirmPay/confirmPay",
"pages/my/my",
"pages/phoneLogin/phoneLogin",
"pages/payResult/payResult"
],
......
......@@ -14,6 +14,22 @@ text {
line-height: 1;
color: #000000;
} */
page {
font-size: 24rpx;
box-sizing: border-box;
}
page::after {
content: '';
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background-color: rgba(0, 0, 0, 0.08);
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.08);
z-index: 100;
}
view,
text,
......
......@@ -92,7 +92,7 @@ Page({
}
} else {
wx.switchTab({
url: '/pages/tabbar/my/my',
url: '/pages/my/my',
})
}
}
......
const app = getApp()
import { Base } from '../../utils/base.js';
import apiList from '../../utils/apiList';
const base = new Base();
Page({
/**
* 页面的初始数据
*/
data: {
canIUseGetUserProfile: false,
showUserInfo: false,
endLoading: false,
list: [],
next_page: 1, // 下一页
has_more: true, // 是否还有更多
locked: false,
limit: 10,
count: '',//工单总数
showOption: false,
index: 0,
optionsList: [
{
id: 1,
name: '本周'
}, {
id: 2,
name: '今日'
}, {
id: 3,
name: '本月'
}, {
id: 4,
name: '全部'
}
],
time_type: 1,//时间段
imgBox: [],
loginFirst: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this
if (wx.canIUse('getUserProfile') && wx.getUserProfile) {
that.setData({
canIUseGetUserProfile: true
})
} else {
that.setData({
canIUseGetUserProfile: false
})
}
app.globalData.tjgs_fresh = false
},
onShow: function () {
this.setData({
isrefresh: this.data.isrefresh ? this.data.isrefresh : false
})
if (this.data.isrefresh || app.globalData.tjgs_fresh) {
this.setData({
isrefresh: false,
endLoading: false,
list: [],
next_page: 1, // 下一页
has_more: true, // 是否还有更多
locked: false,
})
app.globalData.tjgs_fresh = false
setTimeout(() => {
this.getList()
}, 0)
}
},
// 授权获取用户信息
getUserProfile() {
wx.getUserProfile({
desc: '用于完善会员资料',
success: (res) => {
// console.log("res------用于完善会员资料", res)
if (res.errMsg == "getUserProfile:ok") {
app.saveUserInfo(res, this.showUserInfo)
} else {
// console.log("res.errMsg------用于完善会员资料", res.errMsg)
base.toast(res.errMsg)
}
},
fail: (err) => {
base.toast('请先授权,才能验证身份')
}
})
},
// 旧版本 授权获得用户信息
userInfoHandler: function (e) {
let that = this
if (e.detail.errMsg == 'getUserInfo:ok') {
app.saveUserInfo(e.detail, this.showUserInfo)
} else {
base.toast('请先授权,才能验证身份')
}
},
showUserInfo() { // 登录完成之后,执行的事件
console.log(app.globalData.hasTel)
if( !app.globalData.hasTel){
app.globalData.backurl = '/pages/tabbar/my/my'
wx.navigateTo({
url: '/pages/bindTel/bindTel',
})
}
this.setData({
showUserInfo: true
})
this.getList()
},
callPhone(e) {
let tel = e.currentTarget.dataset.tel
wx.makePhoneCall({
phoneNumber: tel
})
},
previewImg: function (e) {
let bigindex = e.currentTarget.dataset.bigindex//外层index
let smallindex = e.currentTarget.dataset.small//内层index
var arr = []
var imgarr = []
var imgArr = []
arr.push(this.data.list[bigindex].image)
for (var i = 0; i < arr.length; i++) {
imgarr.push(arr[i])
for (var j = 0; j < arr[i].length; j++) {
imgArr.push(arr[i][j].url)
}
}
var imgs = imgArr
wx.previewImage({
current: imgs[smallindex],
urls: imgs
})
},
ceshi(){
this.setData({
showOption: false
})
},
showOp() {
this.setData({
showOption: !this.data.showOption
})
},
optionTap(e) {
let Index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
this.setData({
index: Index,
showOption: !this.data.showOption,
time_type: id,
list: [],
next_page: 1
})
this.getList()
},
//保修单列表
getList() {
let params = {
url: apiList.repair_list,
type: "GET",
data: {
page: this.data.next_page,
limit: this.data.limit,
time_type: this.data.time_type
},
callback: (data) => {
var imgArr = []
for (var i = 0; i < data.list.length; i++) {
imgArr.push(data.list[i].image)
}
// console.log(imgArr)
this.setData({
endLoading: true,
list: this.data.next_page == 1 ? data.list : this.data.list.concat(data.list),
has_more: data.more,
next_page: data.page,
locked: false,
count: data.count,
// imgBox: data.list.image
})
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
},
//学生撤回报修单
withDraw(e) {
let repair_order_id = e.currentTarget.dataset.id
let params = {
url: apiList.repair_withdrawn,
type: "POST",
data: {
repair_order_id: repair_order_id.toString()
},
callback: (data) => {
base.toast('已撤回')
this.setData({
next_page: 1
})
this.getList()
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
},
//投诉
complaint(e) {
let repair_order_id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/order/complaint/complaint?id=' + repair_order_id,
})
},
//去评价
goPj(e) {
let repair_order_id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/order/evaluate/evaluate?id=' + repair_order_id,
})
},
//收费明细接口
getFree() {
let params = {
url: apiList.material_list,
type: "GET",
data: {},
callback: (data) => {
console.log(data)
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
},
pay(e) {
var that = this
let repair_order_id = e.currentTarget.dataset.id
let params = {
url: apiList.material_signPay,
type: "GET",
data: {
repair_order_id: repair_order_id
},
callback: (data) => {
console.log(data)
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': data.signType,
'paySign': data.paySign,
'success': function (res) {
console.log(res);
// that.setData({
// isrefresh: true
// })
setTimeout(() => {
wx.navigateTo({
url: '/pages/payResult/payResult?status=1&repair_order_id=' + repair_order_id,
})
}, 1000)
},
'fail': function (res) {
console.log(res);
setTimeout(() => {
wx.navigateTo({
url: '/pages/payResult/payResult?status=0&repair_order_id=' + repair_order_id
})
}, 1000)
}
})
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
},
initData: function () {
this.setData({
endLoading: false,
list: [],
has_more: true,
next_page: 1,
locked: false
})
},
onPullDownRefresh: function () {
this.initData()
if (!this.data.locked) {
this.setData({
locked: true
})
this.getList()
}
wx.stopPullDownRefresh()
},
onReachBottom: function () {
if (!this.data.locked && this.data.has_more) {
this.setData({
locked: true
})
this.getList()
}
}
})
\ No newline at end of file
{
"usingComponents": {},
"enablePullDownRefresh": true,
"navigationBarTitleText": "工单"
}
\ No newline at end of file
<!-- <view wx:if="{{showUserInfo}}" catchtap="ceshi"> -->
<view wx:if="{{endLoading}}">
<view class="top flex-h flex-hb flex-vc">
<view class="total">共{{count}}个工单</view>
<view class="screen" catchtap="showOp">
{{optionsList[index].name}}
<view wx:if="{{showOption}}" class="option">
<view class="option-item" catchtap="optionTap" wx:for="{{optionsList}}" wx:key="index"
data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
</view>
</view>
</view>
<view wx:if="{{list.length>0}}">
<view class="repair-order" wx:for="{{list}}" wx:key="index" data-index="{{index}}">
<view class="order-top flex-h flex-hb">
<view class="order-title">工单详情</view>
<view
class="{{item.order_status_display=='已撤回'||item.order_status_display=='已完成'||item.order_status_display=='已退回'? 'status1' : 'status'}}">
{{item.order_status_display}}</view>
</view>
<view class="detail">
<view class="desc">问题描述:</view>
<view class="desc-cont">{{item.repair_type.type_name}}-{{item.description}}</view>
<view class="desc">
<text class="desc-title">客户姓名:</text>
<text class="desc-cont">{{item.realname}}</text>
</view>
<view class="desc">
<text class="desc-title">联系电话:</text>
<text class="desc-cont">{{item.telephone}}</text>
</view>
<view class="desc">
<text class="desc-title">服务地址:</text>
<text
class="desc-cont">{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</text>
</view>
<view class="desc flex-h">
<text class="desc-title">预约时间:</text>
<text class="desc-cont" style="margin-right:10rpx">{{item.appointment_date}}</text>
<text class="desc-cont">{{item.appointment_time.start_time}}-</text>
<text class="desc-cont">{{item.appointment_time.end_time}}</text>
</view>
<view class="desc flex-h">
<text class="desc-title">图片详情:</text>
<view class="img" wx:for="{{item.image}}" wx:for-item="item" wx:key="idx"
wx:for-index="childindex">
<image class="img" src="{{item.url}}" data-bigindex="{{index}}" data-small="{{childindex}}"
bindtap="previewImg"></image>
</view>
</view>
<view class="line"></view>
<view wx:if="{{item.can_show_worker_info==1}}">
<view class="desc">
<text class="desc-title">派工对象:</text>
<text class="desc-cont">{{item.work_name ? item.work_name : '无'}}</text>
</view>
<!-- <view class="desc">
<text class="desc-title">联系电话:</text>
<text data-tel="{{item.worker.phone}}" bindtap="callPhone"
class="desc-cont phone">{{item.worker.phone}}</text>
</view> -->
</view>
<view wx:if="{{item.order_status_display=='已转单'}}" class="zd">{{item.orderlog_transfer.remark}}
</view>
<view wx:if="{{item.free_material_order}}" class="pay">
<view class="pay-title">备注耗材</view>
<view class="pay-item flex-h flex-hb" wx:for="{{item.free_material_order.goods}}" wx:for-item="child" wx:key="index">
<view class="type goods_name">{{child.good_detail ? child.good_detail : '类型'}}</view>
<view class="type flex-h">
<view class="goods_name text-line-one">{{child.goods_name}}</view>
<view>*{{child.number}}</view>
</view>
<view class="type">¥{{child.price}}</view>
</view>
</view>
<!-- 待支付耗材 -->
<view wx:if="{{item.no_pay_order.goods.length}}" class="pay">
<view class="pay-title">待支付耗材</view>
<view wx:for="{{item.no_pay_order.goods}}" wx:key="index" wx:for-item="parent">
<view class="pay-item flex-h flex-hb" wx:key="index"
>
<view class="type goods_name text-line-one">{{parent.parent_detail.goods_name}}</view>
<view class="type flex-h">
<view class="goods_name text-line-one">
{{parent.good_detail.goods_name}}
</view>
<view>*{{parent.number}}</view>
</view>
<view class="type">¥{{parent.price}}</view>
</view>
</view>
</view>
<view wx:if="{{item.pay_order.length}}" class="pay">
<view class="pay-title">已支付耗材</view>
<view wx:for="{{item.pay_order}}" wx:key="index" wx:for-item="parent">
<view class="pay-item flex-h flex-hb" wx:for="{{parent.goods}}" wx:key="index"
wx:for-item="child">
<view class="type goods_name text-line-one">{{child.parent_detail.goods_name}}</view>
<view class="type flex-h">
<view class="goods_name text-line-one">
{{child.good_detail.goods_name}}
</view>
<view>*{{child.number}}</view>
</view>
<view class="type">¥{{child.price}}</view>
</view>
</view>
</view>
<view wx:if="{{item.order_status_display=='已退回'}}" class="back">
<view class="back-title">审核员退回</view>
<view class="back-cont">{{item.orderlog_one.remark}}</view>
</view>
<view class="flex-h flex-hb flex-vc">
<view class="time">提交时间: {{item.created_at}}</view>
<view wx:if="{{item.can_withdrawn_btn==1}}" catchtap="withDraw" class="ch-btn"
data-id="{{item.id}}">撤回
</view>
<view data-id="{{item.id}}" wx:if="{{item.can_complaint_btn==1}}" class="ts-btn"
catchtap="complaint">投诉</view>
<view data-id="{{item.id}}" wx:if="{{item.can_appraisal_btn==1}}" class="pj-btn"
catchtap="goPj">评价</view>
<view data-id="{{item.id}}" catchtap="pay" wx:if="{{item.can_pay_btn==1}}" class="pay-btn">付款
</view>
<view wx:if="{{item.complaint}}" class="yts-btn">已投诉</view>
<view wx:if="{{item.is_appraisal==1}}" class="yts-btn">已评价</view>
</view>
</view>
</view>
<view class="blank"></view>
</view>
<view wx:else class="noneBox column">
<image src="/images/none.png"></image>
<view>暂无任何工单哦~</view>
</view>
</view>
<!-- </view> -->
\ No newline at end of file
page {
width: 100%;
padding-top: 38rpx;
padding-left: 30rpx;
padding-right: 30rpx;
box-sizing: border-box
}
.top {
width: 690rpx;
height: 58rpx;
}
.top .total {
color: #727272;
font-size: 28rpx;
}
.top .screen {
width: 176rpx;
height: 58rpx;
background: #FFFFFF;
border: 2rpx solid #0054FF;
border-radius: 12rpx;
color: #0054FF;
font-size: 28rpx;
text-align: center;
line-height: 58rpx;
position: relative;
}
.top .screen .option{
width: 176rpx;
/* height: 200rpx; */
background: #fff;
border: 2rpx solid #0054FF;
position: absolute;
top: 57rpx;
left: -1px;
border-radius: 0 0 12rpx 12rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
}
.top .screen .option .option-item{
width: 100%;
height: 48rpx;
color: #0054FF;
}
.repair-order {
width: 690rpx;
background: #FFFFFF;
box-shadow: 0px 0px 12px 1px rgba(214, 214, 214, 0.78);
border-radius: 12rpx;
margin-top: 40rpx;
padding: 40rpx 30rpx;
}
.repair-order .order-top {
margin-bottom: 60rpx;
}
.repair-order .order-top .order-title {
color: #727272;
font-size: 32rpx;
}
.repair-order .order-top .status {
color: #0054FF;
font-size: 32rpx;
font-weight: bold;
}
.repair-order .order-top .status1 {
color: #000000;
font-size: 32rpx;
font-weight: bold;
}
.repair-order .detail .desc {
color: #000000;
font-size: 30rpx;
margin-bottom: 20rpx;
}
.repair-order .detail .desc .desc-title {
margin-right: 10rpx;
}
.repair-order .detail .desc-cont {
color: #727272;
font-size: 30rpx;
margin-bottom: 20rpx;
}
.repair-order .detail .phone {
color: #0054FF;
}
.repair-order .detail .desc .img {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
border-radius: 8rpx;
}
.repair-order .detail .zd {
color: #727272;
font-size: 30rpx;
margin-bottom: 40rpx;
}
.repair-order .detail .line {
width: 628rpx;
height: 1px;
background: #F1F1F1;
margin-top: 40rpx;
margin-bottom: 40rpx;
}
.repair-order .detail .time {
color: #727272;
font-size: 24rpx;
}
.repair-order .detail .ch-btn {
width: 145rpx;
height: 54rpx;
background: #0054FF;
border-radius: 27rpx;
color: #FFFFFF;
font-size: 24rpx;
text-align: center;
line-height: 54rpx;
}
.repair-order .detail .ts-btn {
width: 112rpx;
height: 54rpx;
background: #FFFFFF;
border: 1px solid #0054FF;
border-radius: 27rpx;
color: #0054FF;
text-align: center;
line-height: 54rpx;
font-size: 24rpx;
}
.repair-order .detail .pj-btn {
width: 112rpx;
height: 54rpx;
background: #0054FF;
border-radius: 27rpx;
color: #FFFFFF;
text-align: center;
line-height: 54rpx;
font-size: 24rpx;
}
.repair-order .detail .pay-btn {
width: 145rpx;
height: 54rpx;
background: #0054FF;
border-radius: 27rpx;
color: #FFFFFF;
text-align: center;
line-height: 54rpx;
font-size: 24rpx;
}
.repair-order .detail .yts-btn {
width: 126rpx;
height: 54rpx;
background: #FFFFFF;
border: 1px solid #727272;
border-radius: 27rpx;
color: #727272;
text-align: center;
line-height: 54rpx;
font-size: 24rpx;
}
.repair-order .detail .pay .pay-title {
color: #000000;
font-size: 30rpx;
margin-bottom: 30rpx;
}
.repair-order .detail .pay .pay-item {
margin-bottom: 30rpx;
}
.repair-order .detail .back {
color: #000000;
font-size: 30rpx;
}
.repair-order .detail .back .back-cont {
color: #727272;
margin-top: 26rpx;
margin-bottom: 20rpx;
}
.repair-order .detail .pay .pay-item .type {
color: #727272;
font-size: 30rpx;
}
.goods_name{
width: 148rpx;
}
.blank {
width: 100%;
height: 150rpx;
}
/* 空白页 */
.noneBox {
padding: 140rpx 0 0;
align-items: center;
font-size: 28rpx;
color: #999;
}
.noneBox image {
width: 215rpx;
height: 337rpx;
margin-bottom: 30rpx;
}
.loginbox {
text-align: center;
padding-top: 271rpx;
}
.title_img {
width: 207rpx;
height: 207rpx;
margin-bottom: 25rpx;
}
.title_tip {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 192rpx;
}
.title_btn {
width: 620rpx !important;
height: 82rpx;
background: linear-gradient(270deg, #0054FF, #1965FF);
border-radius: 41rpx;
font-size: 32rpx;
color: #FFFFFF;
}
.title_btn text {
color: #fff;
font-size: 40rpx;
margin-right: 5rpx;
}
.small_tip {
width: 100%;
text-align: center;
font-size: 26rpx;
color: #989794;
margin-top: 40rpx;
}
\ No newline at end of file
const app = getApp()
import { Base } from '../../utils/base';
import apiList from '../../utils/apiList';
const base = new Base();
Page({
data: {
status: '1', //支付状态
repair_order_id: '',
failData: '',
},
onLoad: function (options) {
this.setData({
status: options.status,
repair_order_id: options.repair_order_id
})
console.log('支付状态-----' + options.status)
console.log('支付状态-----' + options.repair_order_id)
},
back(){
app.globalData.tjgs_fresh = true
wx.switchTab({
url: '/pages/tabbar/my/my',
})
},
payAgain(){
let that = this;
let params = {
url: apiList.material_signPay,
type: "GET",
data: {
repair_order_id: this.data.repair_order_id
},
callback: (data) => {
console.log(data)
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': data.signType,
'paySign': data.paySign,
'success': function (res) {
console.log(res);
that.setData({
status: 1
})
},
'fail': function (res) {
that.setData({
status: 0
})
}
})
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "支付结果"
}
\ No newline at end of file
<!-- 成功页面 -->
<view wx:if='{{status == 1}}'>
<view class="paySuccess">
<image class="success_img" src="https://wdty.xueyoubangedu.com/wandou/pic_01.png"></image>
<view class="text">支付成功</view>
<view class="btn" catchtap="back">查看工单</view>
</view>
</view>
<!-- 失败页面 -->
<view class="payStatus" wx:else>
<image class="payPic" src="https://wdty.xueyoubangedu.com/wandou/pay_fail.png">
</image>
<view class="statusWords">支付失败</view>
<view class="statusDesc">抱歉,支付出现问题,请尝试重新支付~</view>
<view class="btn" catchtap="payAgain">重新支付</view>
</view>
\ No newline at end of file
/* 支付失败页面 */
.payStatus {
padding-top: 230rpx;
}
.payPic {
display: block;
width: 158rpx;
height: 158rpx;
margin: 0 auto 49rpx;
}
.statusWords {
text-align: center;
font-weight: bold;
font-size: 38rpx;
color: #1A1A1A;
margin-bottom: 30rpx;
}
.statusDesc {
font-size: 28rpx;
color: #4D4D4D;
text-align: center;
}
.payBtns {
width: 100%;
margin-top: 60rpx;
justify-content: space-around;
margin: 60rpx auto 0;
}
.payBtns view {
width: 260rpx;
height: 76rpx;
line-height: 76rpx;
text-align: center;
border: 1rpx solid #CCCCCC;
font-size: 30rpx;
color: #808080;
border-radius: 38rpx;
}
.payBtns view:nth-child(2) {
color: #9FAA4B;
border-color: #9FAA4B;
}
/* 支付成功页面 */
.paySuccess {
padding: 150rpx 0;
}
.success_img {
display: block;
width: 201rpx;
height: 190rpx;
margin: 0 auto 30rpx;
}
.text {
text-align: center;
color: #1A1A1A;
font-size: 30rpx;
font-weight: bold;
}
.cont {
width: 690rpx;
height: 487rpx;
margin: 64rpx auto 40rpx;
background: #fff;
border-radius: 10rpx;
box-shadow: 0px 3rpx 12rpx 0px rgba(0, 0, 0, 0.05);
padding-top: 48rpx;
/* background-image: url('https://wdty.xueyoubangedu.com/wandou/pic_03.png'); */
/* background-size: 100% 100%; */
}
.cont .title {
color: #1A1A1A;
font-size: 24rpx;
text-align: center;
}
.cont .code {
display: block;
width: 211rpx;
height: 211rpx;
margin: 32rpx auto 18rpx;
}
.cont .code image {
width: 100%;
height: 100%;
}
.cont .save {
color: #808080;
font-size: 24rpx;
text-align: center;
}
.cont .wx {
color: #1A1A1A;
font-size: 24rpx;
text-align: center;
margin-top: 20rpx;
}
.cont .wx .copy {
color: #FF6E00;
font-size: 24rpx;
margin-left: 18rpx;
text-decoration: underline;
}
/* 返回按钮样式 */
.btn {
width: 620rpx;
height: 80rpx;
background: linear-gradient(270deg, #0054FF, #1965FF);
border-radius: 40px;
color: #fff;
font-size: 30rpx;
line-height: 80rpx;
text-align: center;
margin: 150rpx auto;
}
\ No newline at end of file
const app = getApp()
const util = require('../../utils/util');
import {
Base
} from '../../utils/base.js';
const base = new Base()
Page({
data: {
tel: '',
password: '',
locked: false,
},
key_Tel: function (e) {
this.setData({
tel: e.detail.value
})
console.log(this.data.tel)
},
key_password: function (e) {
this.setData({
password: e.detail.value
})
},
telBind: function () {
let reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
let that = this
const {
tel,
password
} = this.data
if (!tel) {
base.toast('请输入手机号')
return
}
if (!reg.test(tel)) {
base.toast("手机号码输入有误");
return;
}
if (!password) {
base.toast('请输入密码')
return
}
if (!this.data.locked) {
that.setData({
locked: true
})
let params = {
url: 'user/unbind',
data: {
tel: tel,
password: password
},
type: "POST",
callback: (data) => {
console.log(data)
}
}
base.newRequest(params)
}
},
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "登录"
}
\ No newline at end of file
<view class="changeRow row">
<input type="text" placeholder="请输入手机号" maxlength="11" bindinput="key_Tel" value="{{tel}}" />
</view>
<view class="changeRow row">
<input class="codeInp" type="text" placeholder="请输入密码" bindinput="key_password" value="{{password}}" />
</view>
<view class="confirmBtn" catchtap="telBind">登录</view>
page{
padding: 40rpx 30rpx;
}
.changeRow{
height: 118rpx;
border-bottom: 1rpx solid #EBEBEB;
justify-content: space-between;
align-items: center;
}
.changeRow input{
width: 100%;
height: 118rpx;
font-size: 30rpx;
}
.changeRow input.codeInp{
width: 400rpx;
}
.changeRow .getBtn{
padding: 0 12rpx;
height: 62rpx;
line-height: 62rpx;
border: 1px solid #9FAA4B;
color: #9FAA4B;
font-size: 30rpx;
border-radius: 8rpx;
}
.confirmBtn{
width: 690rpx;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 44rpx;
position: fixed;
left: 30rpx;
bottom: 46rpx;
z-index: 10;
color: #000000;
font-size: 32rpx;
text-align: center;
}
\ No newline at end of file
const app = getApp()
const util = require('../../../utils/util');
import apiList from '../../../utils/apiList';
import {
Base
} from '../../../utils/base.js';
const base = new Base()
Page({
/**
* 页面的初始数据
*/
data: {
button: true,
isHide: false,//另一个立即支付按钮(隐藏)
phone: '',
note: '',
tel: '',
templateList: [], //订阅模板消息通知
},
onLoad: function (options) {
// console.log(wx.getStorageSync('userTel'))
// this.getTemplate()
},
onShow: function () {
if (wx.getStorageSync('userTel')) {
this.setData({
tel: wx.getStorageSync('userTel'),
phone: wx.getStorageSync('userTel'),
})
}
},
keyPhone: function (e) {
this.setData({
phone: e.detail.value
})
},
keyNote: function (e) {
this.setData({
note: e.detail.value
})
},
getPhoneNumber: function (e) {
console.log(e)
if (e.detail.errMsg == 'getPhoneNumber:ok') {
let params = {
url: 'user/switchPhone',
data: {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
},
type: "POST",
callback: (data) => {
base.toast('授权成功')
app.globalData.userTel = data.phoneNumber
wx.setStorageSync('userTel', data.phoneNumber)
this.setData({
tel: wx.getStorageSync('userTel'),
phone: wx.getStorageSync('userTel')
})
}
}
base.newRequest(params)
} else {
base.toast('授权失败,无法查看')
}
},
getTemplate: function () {
var that = this
let params = {
url: 'subscribe/list',
data: {
type: 3
},
callback: (data) => {
that.setData({
templateList: data.template_id
})
}
}
base.newRequest(params)
},
pay(e) {
var that = this
// let repair_order_id = e.currentTarget.dataset.id
let params = {
url: apiList.material_signPay,
type: "GET",
data: {
repair_order_id: 160
},
callback: (data) => {
console.log(data)
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': data.signType,
'paySign': data.paySign,
'success': function (res) {
console.log(res);
setTimeout(() => {
wx.navigateTo({
url: '/pages/payResult/payResult?status=1&repair_order_id=' + repair_order_id,
})
}, 1000)
},
'fail': function (res) {
console.log(res);
setTimeout(() => {
wx.navigateTo({
url: '/pages/payResult/payResult?status=0&repair_order_id=' + repair_order_id
})
}, 1000)
}
})
},
}
wx.showLoading({
title: '努力加载中...',
})
base.newRequest(params)
},
// pay() {
// let that = this
// that.setData({
// isHide: true,
// button: false
// })
// if(!this.data.phone) {
// base.toast('请输入手机号')
// that.setData({
// isHide: false,
// button: true
// })
// return
// }
// if(!this.data.note) {
// base.toast('请填写备注')
// that.setData({
// isHide: false,
// button: true
// })
// return
// }
// let params = {
// url: '/api/order/quick_pay',
// type: 'post',
// data: {
// price: 240,
// tel: this.data.phone,
// remark: this.data.note,
// // stadium_id: app.globalData.stadium_id
// stadium_id: 21,
// },
// callback: (data) => {
// console.log(data)
// wx.requestPayment({
// 'timeStamp': data.pay.timeStamp,
// 'nonceStr': data.pay.nonceStr,
// 'package': data.pay.package,
// 'signType': data.pay.signType,
// 'paySign': data.pay.paySign,
// 'success': function (res) {
// that.setData({
// isHide: false,
// button: true
// })
// setTimeout(()=>{
// wx.redirectTo({
// url: '/pages/quickPay/payMent/payMent',
// })
// }, 1000)
// },
// 'fail': function (res) {
// that.setData({
// isHide: false,
// button: true
// })
// wx.showToast({
// title: '支付失败请重试',
// icon: 'none',
// duration: 3000
// })
// console.log(res)
// }
// })
// },
// confirmback: () => {
// that.setData({
// isHide: false,
// button: true
// })
// }
// }
// base.newRequest(params)
// }
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "订单支付"
}
\ No newline at end of file
<view>
<view class="logo-view">
<image src="/images/login.png"></image>
</view>
<view class="top">
<view>豌豆体育正式课</view>
<view>¥240</view>
</view>
<!-- <view class="item">
<view class="dataRow flex-h flex-vc flex-hb">
<view class="phone">联系电话</view>
<input type="number" placeholder="请输入手机号" placeholder-class="placeholder" bindinput="keyPhone" value="{{phone}}" />
</view>
<view class="line"></view>
<view class="dataRow flex-h flex-vc flex-hb">
<view class="phone">备注</view>
<input type="text" placeholder="请输入备注" placeholder-style='text-align:right' bindinput="keyNote"
value="{{note}}" />
</view>
</view> -->
<view class="share-btn">
<button class="pay" wx:if="{{button}}" catchtap="pay">立即支付</button>
<button class="pay" wx:if="{{isHide}}">立即支付</button>
</view>
</view>
\ No newline at end of file
page {
background: #F7F8FA;
}
.logo-view image {
display: block;
margin: 96rpx auto 96rpx auto;
width: 216rpx;
height: 216rpx;
}
.top {
width: 690rpx;
height: 192rpx;
background: #FFFFFF;
border-radius: 15rpx;
margin: 0 auto;
text-align: center;
padding-top: 40rpx;
color: #1A1A1A;
}
.top view:nth-child(1) {
margin-bottom: 20rpx;
font-size: 32rpx;
font-weight: bold;
}
.top view:nth-child(2) {
font-size: 52rpx;
font-weight: bold;
}
.item {
width: 690rpx;
height: 192rpx;
background: #FFFFFF;
border-radius: 15rpx;
margin: 20rpx auto;
padding: 38rpx 30rpx 40rpx;
}
/* .dataRow .placeholder {
width: 186rpx;
height: 42rpx;
background: #9FAA4A;
border-radius: 6rpx;
color: #FFFFFF;
font-size: 28rpx;
text-align: center;
line-height: 42rpx;
} */
.item .phone {
color: #4D4D4D;
font-size: 28rpx;
}
.item .phone_btn {
width: 186rpx;
height: 42rpx;
background: #9FAA4A;
border-radius: 6rpx;
color: #FFFFFF;
font-size: 28rpx;
text-align: center;
line-height: 6rpx;
padding-left: 0 !important;
padding-right: 0 !important;
}
input{
text-align: right;
}
.item .line {
width: 620rpx;
height: 1rpx;
background: #EBEBEB;
margin: 24rpx auto;
}
.item .note {
color: #999999;
font-size: 28rpx;
}
.share-btn {
position: fixed;
left: 0;
bottom: 0;
width: 750rpx;
height: 140rpx;
background: #F7F8FA;
}
.share-btn .pay {
width: 620rpx;
height: 80rpx;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 40px;
margin: 30rpx auto;
color: #000000;
font-size: 30rpx;
line-height: 55rpx;
text-align: center;
}
\ No newline at end of file
const app = getApp()
import {
Base
} from '../../../utils/base.js';
const base = new Base()
Page({
data: {
die: false,
// isBindTel: false,
canIUseGetUserProfile: false,
},
onLoad: function (options) {
if (wx.getUserProfile && wx.canIUse('getUserProfile')) {
this.setData({
canIUseGetUserProfile: true
})
} else {
this.setData({
canIUseGetUserProfile: false
})
}
},
onShow() {
this.setData({
// isBindTel: app.globalData.hasTel
})
},
userInfoHandler: function (e) {
if (e.detail.errMsg == 'getUserInfo:ok') {
app.saveUserInfo(e.detail, this.tc)
} else {
base.toast('请先授权,才能验证身份')
}
},
getUserProfile(e) {
wx.getUserProfile({
desc: '获取中',
success: (res) => {
console.log(res)
if (res.errMsg == 'getUserProfile:ok') {
app.saveUserInfo(res, this.tc)
} else {
base.toast('请先授权,才能验证身份')
}
},
fail: function (res) {
console.log(res)
base.toast('授权失败,无法登陆')
}
})
},
tc() {
setTimeout(() => {
wx.redirectTo({
url: '../confirmPay/confirmPay',
})
}, 800)
},
checkVisions: function () {
if (wx.canIUse !== undefined && wx.canIUse('button.open-type.getUserInfo')) {
this.setData({
die: false
})
} else {
this.setData({
die: true
})
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法更好体验该功能,请先升级微信到最新版',
showCancel: true
})
}
},
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "登录"
}
\ No newline at end of file
<view class="loginBox">
<view class="logo-view">
<image src="/images/login.png"></image>
</view>
<view class="title">豌豆队长</view>
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 微信一键注册/登录 </button>
<button wx:else class="flex-h flex-vc flex-hc" open-type="getUserInfo" bindgetuserinfo="userInfoHandler"
catchtap="checkVisions">
<!-- <image src="/images/my/wx.png"></image> -->
微信一键注册/登录
</button>
<view class="desc">请登录查看更多内容</view>
</view>
<!-- <view>
<import src='../../../components/login/login' />
<template is="login"></template>
</view> -->
\ No newline at end of file
/* @import '/components/login/login.wxss'; */
.loginBox {
padding-top: 174rpx;
}
.logo-view image {
display: block;
margin: 0 auto 41rpx auto;
width: 216rpx;
height: 216rpx;
}
.loginBox .title {
color: #333;
font-weight: bold;
text-align: center;
font-size: 36rpx;
font-weight: bold;
color: #000000;
}
.loginBox button {
width: 620rpx !important;
height: 82rpx !important;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
color: #000000;
border-radius: 41rpx;
margin: 184rpx auto 30rpx auto;
font-size: 30rpx;
border: none;
outline: none;
line-height: 57rpx;
}
.loginBox button image {
width: 45rpx;
height: 36rpx;
margin-right: 14rpx;
}
.desc {
font-size: 24rpx;
color: #999999;
text-align: center;
}
\ No newline at end of file
// pages/translate/translate.js
const app = getApp()
import { Base } from '../../utils/base.js';
import apiList from '../../utils/apiList';
const base = new Base();
Page({
/**
* 页面的初始数据
*/
data: {
endLoading: false,
list: [
{
bigUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
littleUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
name: '金地物业秋季线上校园宣讲会',
time: '10-12 09:00'
},
{
bigUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
littleUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
name: '泡泡玛特秋季线上校园宣讲会',
time: '10-13 09:00'
},
{
bigUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
littleUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
name: '蔚来汽车秋季线上校园宣讲会',
time: '10-14 09:00'
},
],
},
......
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true
}
\ No newline at end of file
<view class="img">
<image src="/images/ceshi.png"></image>
<view>
<view wx:if="{{list.length>0}}">
<view class="item" wx:for="{{list}}" wx:key="index" data-index="{{index}}">
<view class="fm">
<view class="time">{{item.time}}</view>
<image class="fm-img" src="{{item.bigUrl}}"></image>
</view>
<view class="company flex-h flex-vc">
<view class="img">
<image src="{{item.littleUrl}}"></image>
</view>
<view class="company_name">{{item.name}}</view>
</view>
</view>
</view>
<view wx:else class="noneBox column">
<image src="/images/none.png"></image>
<view>暂无任何工单哦~</view>
</view>
</view>
\ No newline at end of file
page{
box-sizing: border-box !important;
padding: 30rpx;
background: #F2F4F7;
}
.item{
width: 690rpx;
border-radius: 16rpx;
background: #FFFFFF;
margin-bottom: 25rpx;
}
.item .fm{
width: 100%;
height: 100%;
height: 310rpx;
border-radius: 16px 16px 0px 0px;
position: relative;
}
.img{
.item .fm .time{
position: absolute;
top: 30rpx;
left: 30rpx;
width: 160rpx;
height: 42rpx;
background: rgba(0, 0, 0, 0.3);
color:#FFFFFF;
font-size: 24rpx;
line-height: 42rpx;
text-align: center;
}
.item .fm .fm-img{
width: 100%;
height: 100%;
height: 310rpx;
border-radius: 16px 16px 0px 0px;
}
.img image{
.item .company{
width: 100%;
height: 100%;
}
\ No newline at end of file
height: 102rpx;
padding: 38rpx 30rpx;
}
.item .company .img{
width: 37rpx;
height: 37rpx;
margin-right: 22rpx;
}
.item .company .img image{
width: 37rpx;
height: 37rpx;
}
.item .company .company_name{
color: #1A1A1A;
font-size: 30rpx;
font-weight: bold;
}
.noneBox {
padding: 140rpx 0 0;
align-items: center;
font-size: 28rpx;
color: #999;
}
.noneBox image {
width: 215rpx;
height: 337rpx;
margin-bottom: 30rpx;
}
\ No newline at end of file
......@@ -42,7 +42,7 @@
"compileType": "miniprogram",
"libVersion": "2.16.1",
"appid": "wxafaf02db6f71f4a3",
"projectname": "%E6%8A%A5%E4%BF%AE%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"projectname": "天择人才小程序",
"debugOptions": {
"hidedInDevtools": []
},
......
{
"setting": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "提交工单页面",
"pathName": "pages/detail/index/index",
"query": "",
"scene": null
"setting": {},
"condition": {
"plugin": {
"list": []
},
{
"name": "工单页面",
"pathName": "pages/tabbar/my/my",
"query": "",
"scene": null
"game": {
"list": []
},
{
"name": "登录",
"pathName": "pages/login/index/index",
"query": "",
"scene": null
"gamePlugin": {
"list": []
},
{
"name": "评价",
"pathName": "pages/order/evaluate/evaluate",
"query": "id=62",
"scene": null
},
{
"name": "pages/order/lookCost/lookCost",
"pathName": "pages/order/lookCost/lookCost",
"query": "",
"scene": null
"miniprogram": {
"list": [
{
"name": "提交工单页面",
"pathName": "pages/detail/index/index",
"query": "",
"scene": null
},
{
"name": "工单页面",
"pathName": "pages/tabbar/my/my",
"query": "",
"scene": null
},
{
"name": "登录",
"pathName": "pages/login/index/index",
"query": "",
"scene": null
},
{
"name": "评价",
"pathName": "pages/order/evaluate/evaluate",
"query": "id=62",
"scene": null
},
{
"name": "pages/order/lookCost/lookCost",
"pathName": "pages/order/lookCost/lookCost",
"query": "",
"scene": null
},
{
"name": "pages/quickPay/confirmPay/confirmPay",
"pathName": "pages/quickPay/confirmPay/confirmPay",
"query": "",
"scene": null
},
{
"name": "pages/quickPay/login/login",
"pathName": "pages/quickPay/login/login",
"query": "",
"scene": null
},
{
"name": "pages/my/my",
"pathName": "pages/my/my",
"query": "",
"scene": null
},
{
"name": "pages/phoneLogin/phoneLogin",
"pathName": "pages/phoneLogin/phoneLogin",
"scene": null
}
]
}
]
}
}
}
\ No newline at end of file
......@@ -77,32 +77,32 @@ class Base {
}
})
}
changeToken(params){
changeToken(params) {
wx.showLoading({
title: '努力加载中...',
title: '努力加载中...',
})
let that = this
let tokenUrl = that.baseUrl + '/api/v1.0/change/token'
let tokenUrl = that.baseUrl + '/api/v1.0/change/token'
wx.request({
url: tokenUrl,
data: {
},
method:'post',
method: 'post',
header: {
'content-type': 'application/json', // 默认值
Authorization: app.globalData.first_token
},
success (res) {
success(res) {
wx.hideLoading() //隐藏加载动画
if (res.statusCode == 200) {
let rstcode = res.data.meta.code
if (rstcode == 200) {
app.globalData.first_token = res.data.data.access_token
that.newRequest(params)
}else{
} else {
app.getSessionKey(function () {
that.newRequest(params, true,true)
that.newRequest(params, true, true)
})
}
}
......@@ -110,7 +110,7 @@ class Base {
})
}
//富文本
richText(detail) {
......@@ -222,16 +222,16 @@ class Base {
})
setTimeout(function () {
wx.navigateBack({
delta: parseInt(num-1)
delta: parseInt(num - 1)
})
}, 800)
}
//七牛上传
initQiniu() {
var options = {
uptokenURL: 'https://repairtest.zeruiedu.com/api/v1.0/upload/token',
domain: 'https://fhxm.xueyoubangedu.com/',
uploadURL: 'https://up-z1.qiniup.com'
uptokenURL: 'https://repairtest.zeruiedu.com/api/v1.0/upload/token',
domain: 'https://fhxm.xueyoubangedu.com/',
uploadURL: 'https://up-z1.qiniup.com'
};
qiniuUploader.init(options);
}
......
This diff is collapsed.
var _createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||false;d.configurable=true;if("value" in d){d.writable=true}Object.defineProperty(e,d.key,d)}}return function(d,b,c){if(b){a(d.prototype,b)}if(c){a(d,c)}return d}}();function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:"key格式错误",PARAM_ERR:310,PARAM_ERR_MSG:"请求参数信息有误",SYSTEM_ERR:600,SYSTEM_ERR_MSG:"系统错误",WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL="https://apis.map.qq.com/ws/";var URL_SEARCH=BASE_URL+"place/v1/search";var URL_SUGGESTION=BASE_URL+"place/v1/suggestion";var URL_GET_GEOCODER=BASE_URL+"geocoder/v1/";var URL_CITY_LIST=BASE_URL+"district/v1/list";var URL_AREA_LIST=BASE_URL+"district/v1/getchildren";var URL_DISTANCE=BASE_URL+"distance/v1/";var Utils={location2query:function location2query(c){if(typeof c=="string"){return c}var b="";for(var a=0;a<c.length;a++){var e=c[a];if(!!b){b+=";"}if(e.location){b=b+e.location.lat+","+e.location.lng}if(e.latitude&&e.longitude){b=b+e.latitude+","+e.longitude}}return b},getWXLocation:function getWXLocation(c,b,a){wx.getLocation({type:"gcj02",success:c,fail:b,complete:a})},getLocationParam:function getLocationParam(b){if(typeof b=="string"){var a=b.split(",");if(a.length===2){b={latitude:b.split(",")[0],longitude:b.split(",")[1]}}else{b={}}}return b},polyfillParam:function polyfillParam(a){a.success=a.success||function(){};a.fail=a.fail||function(){};a.complete=a.complete||function(){}},checkParamKeyEmpty:function checkParamKeyEmpty(c,b){if(!c[b]){var a=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+b+"参数格式有误");c.fail(a);c.complete(a);return true}return false},checkKeyword:function checkKeyword(a){return !this.checkParamKeyEmpty(a,"keyword")},checkLocation:function checkLocation(c){var a=this.getLocationParam(c.location);if(!a||!a.latitude||!a.longitude){var b=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+" location参数格式有误");c.fail(b);c.complete(b);return false}return true},buildErrorConfig:function buildErrorConfig(a,b){return{status:a,message:b}},buildWxRequestConfig:function buildWxRequestConfig(c,a){var b=this;a.header={"content-type":"application/json"};a.method="GET";a.success=function(d){var e=d.data;if(e.status===0){c.success(e)}else{c.fail(e)}};a.fail=function(d){d.statusCode=ERROR_CONF.WX_ERR_CODE;c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,result.errMsg))};a.complete=function(d){var e=+d.statusCode;switch(e){case ERROR_CONF.WX_ERR_CODE:c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,d.errMsg));break;case ERROR_CONF.WX_OK_CODE:var f=d.data;if(f.status===0){c.complete(f)}else{c.complete(b.buildErrorConfig(f.status,f.message))}break;default:c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR,ERROR_CONF.SYSTEM_ERR_MSG))}};return a},locationProcess:function locationProcess(f,e,c,a){var d=this;c=c||function(g){g.statusCode=ERROR_CONF.WX_ERR_CODE;f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))};a=a||function(g){if(g.statusCode==ERROR_CONF.WX_ERR_CODE){f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))}};if(!f.location){d.getWXLocation(e,c,a)}else{if(d.checkLocation(f)){var b=Utils.getLocationParam(f.location);e(b)}}}};var QQMapWX=function(){function b(i){_classCallCheck(this,b);if(!i.key){throw Error("key值不能为空")}this.key=i.key}_createClass(b,[{key:"search",value:function f(i){var l=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var k={keyword:i.keyword,orderby:i.orderby||"_distance",page_size:i.page_size||10,page_index:i.page_index||1,output:"json",key:l.key};if(i.address_format){k.address_format=i.address_format}if(i.filter){k.filter=i.filter}var n=i.distance||"1000";var j=i.auto_extend||1;var m=function m(o){k.boundary="nearby("+o.latitude+","+o.longitude+","+n+","+j+")";wx.request(Utils.buildWxRequestConfig(i,{url:URL_SEARCH,data:k}))};Utils.locationProcess(i,m)}},{key:"getSuggestion",value:function h(i){var k=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var j={keyword:i.keyword,region:i.region||"全国",region_fix:i.region_fix||0,policy:i.policy||0,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_SUGGESTION,data:j}))}},{key:"reverseGeocoder",value:function a(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={coord_type:i.coord_type||5,get_poi:i.get_poi||0,output:"json",key:k.key};if(i.poi_options){j.poi_options=i.poi_options}var l=function l(m){j.location=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))};Utils.locationProcess(i,l)}},{key:"geocoder",value:function g(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"address")){return}var j={address:i.address,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))}},{key:"getCityList",value:function c(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={output:"json",key:k.key};
wx.request(Utils.buildWxRequestConfig(i,{url:URL_CITY_LIST,data:j}))}},{key:"getDistrictByCityId",value:function d(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"id")){return}var j={id:i.id||"",output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_AREA_LIST,data:j}))}},{key:"calculateDistance",value:function e(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"to")){return}var j={mode:i.mode||"walking",to:Utils.location2query(i.to),output:"json",key:k.key};var l=function l(m){j.from=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_DISTANCE,data:j}))};if(i.from){i.location=i.from}Utils.locationProcess(i,l)}}]);return b}();module.exports=QQMapWX;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment