소스 검색

fix: buy chose

wangyuan 2 년 전
부모
커밋
78a097846b
2개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      api/request.js
  2. 1 2
      pages/buy/buy.js

+ 3 - 3
api/request.js

@@ -1,6 +1,6 @@
 /* wx.request */
-const BASE_API_URL = 'https://api.itthealth.com/api'
-const BASE_FILE_API_URL = 'https://api.itthealth.com/api'
+//const BASE_API_URL = 'https://api.itthealth.com/api'
+const BASE_API_URL = 'https://itt.chl6zk.store/api'
 const BASE_API_VERSION = '/v1'
 import itt from '../utils/util'
 const app = getApp()
@@ -62,7 +62,7 @@ export const wxRequest = (url,data) => {
 export const wxUpload = (url, data) => {
   return new Promise((resolve, reject) => {
     wx.uploadFile({
-      url: BASE_FILE_API_URL + url + BASE_API_VERSION,
+      url: BASE_API_URL + url + BASE_API_VERSION,
       filePath: data.filePath,
       name: 'file',
       formData: {

+ 1 - 2
pages/buy/buy.js

@@ -98,9 +98,8 @@ Page({
   handlePayType (e) {
     var index = Number(e.currentTarget.dataset.index)
     var goodsInfo = e.currentTarget.dataset.goodsinfo
-    console.log(goodsInfo, 'goodsInfo');
     this.setData({
-      activeIndex: index,
+      activeIndex: this.data.goodsList.length == 1 ? 0 : index,
       goodsId: goodsInfo.goodsId,
       orderAmount: goodsInfo.salePrice,
       num: goodsInfo.donateNumber + goodsInfo.useNumber