|
@@ -1,7 +1,7 @@
|
|
|
// pages/buy/buy.js
|
|
|
import { goodsList } from '../../api/index'
|
|
|
import { submitOrder } from '../../api/pay'
|
|
|
-import itt from '../../utils/util'
|
|
|
+import { getAccountNmber } from '../../api/appointment'
|
|
|
const app = getApp()
|
|
|
|
|
|
Page({
|
|
@@ -10,6 +10,7 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ count: 0,
|
|
|
activeIndex: -1,
|
|
|
goodsList: [],
|
|
|
goodsId: '',
|
|
@@ -24,12 +25,23 @@ Page({
|
|
|
*/
|
|
|
onShow() {
|
|
|
this.getGoodsList()
|
|
|
+ this.getAccountNmberFn()
|
|
|
this.setData({
|
|
|
appusername: app.globalData.userInfo.userName.length > 4 ? app.globalData.userInfo.userName.substring(0,4) : app.globalData.userInfo.userName,
|
|
|
appuserheadimg: app.globalData.userInfo.headImg
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 获取套餐次数
|
|
|
+ getAccountNmberFn () {
|
|
|
+ var that = this
|
|
|
+ getAccountNmber({}).then(res => {
|
|
|
+ that.setData({
|
|
|
+ count: res.data
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
//获取套餐列表
|
|
|
getGoodsList () {
|
|
|
wx.showLoading({
|
|
@@ -90,7 +102,7 @@ Page({
|
|
|
var data = {
|
|
|
goodsId: this.data.goodsId,
|
|
|
orderAmount: this.data.orderAmount,
|
|
|
- num: this.data.num
|
|
|
+ num: 1
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: '加载中...',
|