禾匠小程式最新修複若幹bug,測試完畢
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiI2EzX4xSZz91ZsAzNfRHLGZkRGZkRfJ3bs92YsAjMfVmepNHL3VERNNTQq5kMrRlTsdUW240QZZTQClGVF5UMR9Fd4VGdsATNfd3bkFGazxycykFaKdkYzZUbapXNXlleSdVY2pESa9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnL3AzM5EzN1MDM1ETOwEjMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
具體步驟如下:
Node.js + 小程式開發者工具
安裝、運作
指令行切換到代碼目錄下,執行以下指令安裝依賴
npm install
建立配置下面兩個檔案
/src/siteInfo.js檔案 小程式配置如下:
module.exports = {
'acid': -1,
'version': '1.0.0',
'siteroot': 'http://localhost/app/index.php',
'apiroot': 'https://localhost/web/index.php?_mall_id=1',
};
h5配置如下:
let siteInfo = {
'acid': -1,
'version': '1.0.0',
'apiroot': 'https://localhost/web/index.php?_mall_id=1',
'id': '1',
};
修改apiroot成自己的伺服器路徑,_mall_id可從背景的小程式商城清單擷取到ID,id為背景的小程式商城清單擷取到ID
/src/manifest.json檔案
{
"name": "zjhj_bd_app",
"appid": "",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"uniStatistics": {
"enable": false
},
"app-plus": {
},
"quickapp": {
},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "請求擷取您的位置資訊"
}
}
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"appid": "",
"usingComponents": true
},
"mp-toutiao": {
"appid": "",
"usingComponents": true,
"urlCheck": false
},
"mp-qq": {
"usingComponents": true
},
"h5": {
"async": {
"loading": "AsyncLoading",
"error": "AsyncError",
"delay": 2000,
"timeout": 10000
},
"uniStatistics" : {
"enable" : true
},
"publicPath" : "/addons/zjhj_bd/h5/",
"router" : {
"base" : "/addons/zjhj_bd/h5/",
"mode" : "hash"
},
"sdkConfigs": {
"maps": {
"qqmap": {
// 騰訊地圖秘鑰(key)https://lbs.qq.com/dev/console/key/manage
"key": ""
}
}
}
},
}
mp-weixin/appid填寫上微信小程式的appid
h5編譯時需要注意檔案路徑問題:目前需要将h5編譯後的檔案解壓到域名根目錄/addons/zjhj_bd/h5/路徑下;