123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- import { get } from "../../../utils/http"
- // subPackagesD/pages/skinPlan/skinPlan.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- store_id:'',//店铺ID
- skinPlanList:[],//护理方案详情
- scheme_id:'',//推荐方案id
- icon:{
- p10:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/pjbs%402x.png',
- p18:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/bsbs%402x.png',
- p12:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/mbdy%402x%20%281%29.png',
- p28:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/mbdy%402x%281%29.png',
- p13:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/mbdy%402x.png',
- p25:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/ybhl%402x.png',
- p26:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/pdxy%402x.png',
- p27:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/tljz%402x.png',
- p22:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20221108/dbks%402x.png',
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.setData({
- store_id:wx.getStorageSync('store_id'),
- scheme_id:options.scheme_id
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- // 获取护理方案
- this.getSkinPlan()
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- },
- // 获取护理方案
- getSkinPlan(){
- get('v2/api/scheme/info',{
- scheme_id:"", //方案ID,不填则获取最新方案
- },(res)=>{
- if(res.code==200){
- res.data.forEach(item=>{
- item.project_list.forEach(item1=>{
- item1.category_id = 'p'+item1.category_id
- item1.project_name = item1.project_name.substring(item1.project_name.lastIndexOf("】")+1);
- })
- })
- this.setData({
- skinPlanList:res.data
- })
- }
- })
- },
- // 跳转到项目详情
- goProjectDetail(e){
- let id = e.currentTarget.dataset.id
- // source=project&id=137&store_id=20
- wx.navigateTo({
- url: `/pages/projectDetail/projectDetail?source=project&id=${id}&store_id=${this.data.store_id}`,
- })
- }
- })
|