1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-purine-details"],{2479:function(e,t,a){"use strict";a.r(t);var o=a("6166"),i=a.n(o);for(var n in o)"default"!==n&&function(e){a.d(t,e,(function(){return o[e]}))}(n);t["default"]=i.a},2981:function(e,t,a){"use strict";var o=a("4ea4");a("d3b7"),Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.uploading=t.request=void 0;var i=o(a("6c25")),n={apiUrl:"http://api.water.shangkelian.cn/api/",timeout:6e4};t.config=n;var s=!1,l=function(e,t){if("undefined"!==e.url&&""!==e.url)return n.header={Accept:"application/json",Authorization:i.default.getters.getToken||""},t||uni.showLoading({title:"加载中",mask:!0}),new Promise((function(t,a){uni.request({url:n.apiUrl+e.url,timeout:n.timeout,header:n.header||{},data:e.data||{},method:e.method||"GET",success:function(e){if(e.header.Authorization&&c("token",e.header.Authorization),200===e.statusCode){uni.hideLoading();var o=e.data;return 200===o.status_code?void t(o.data):401===o.status_code?void v():void a(o)}u(e.statusCode)}})}));uni.showToast({title:"请求地址不能为空",icon:"none"})};t.request=l;var r=function(e){return uni.showLoading({title:"上传中",mask:!0}),n.header={Accept:"application/json",Authorization:i.default.getters.getToken||""},new Promise((function(t,a){uni.uploadFile({url:n.apiUrl+"storage/uploads",files:e,header:n.header||{},success:function(e){if(200===e.statusCode){uni.hideLoading();var o=JSON.parse(e.data);return 200===o.status_code?void t(o.data):void a(o)}u(e.statusCode)}})}))};t.uploading=r;var u=function(e){switch(e){case 404:uni.showToast({title:e+"接口不存在,请联系系统管理员",icon:"none"});break;case 405:uni.showToast({title:e+"请检查接口请求方式错误",icon:"none"});break;case 500:uni.showToast({title:e+"服务端错误,请检查服务器信息",icon:"none"});break}},c=function(e){i.default.commit("setToken",e)},v=function(){s||(s||(s=!0),c(""),uni.showModal({title:"登录提示",content:"您的登录信息已过期,请重新登录",confirmColor:"#8b64fd",showCancel:!1,success:function(e){s=!1,e.confirm&&uni.reLaunch({url:"/pages/index/index"})}}))}},"30ba":function(e,t,a){var o=a("94fd");"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var i=a("4f06").default;i("6fcb0d66",o,!0,{sourceMap:!1,shadowMode:!1})},6166:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a("e36a"),i={data:function(){return{foodData:"",count:"",orderId:"",canVote:""}},onShow:function(){this.foodInfo()},methods:{foodInfo:function(){var e=this;(0,o.foodDet)(this.$Route.query.id).then((function(t){e.foodData=t,e.count=t.count,e.orderId=t.count.grade,e.canVote=t.can.vote})).catch((function(e){uni.showToast({title:e.message,icon:"none"})}))},voteClick:function(e){var t=this;if(this.$store.getters.getToken)return this.canVote?void(0,o.foodVote)(this.$Route.query.id,e).then((function(e){uni.showToast({title:e,icon:"none"}),t.foodInfo()})).catch((function(e){uni.showToast({title:e.message,icon:"none"})})):void uni.showToast({title:"您已经投过票了",icon:"none"});this.$Router.push({name:"Login"})}}};t.default=i},"76e9":function(e,t,a){"use strict";var o=a("30ba"),i=a.n(o);i.a},"7b31":function(e,t,a){"use strict";a.r(t);var o=a("c1c4"),i=a("2479");for(var n in i)"default"!==n&&function(e){a.d(t,e,(function(){return i[e]}))}(n);a("76e9");var s,l=a("f0c5"),r=Object(l["a"])(i["default"],o["b"],o["c"],!1,null,"7ea52cb9",null,!1,o["a"],s);t["default"]=r.exports},"94fd":function(e,t,a){var o=a("24fb");t=o(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* uview scss */\n/* 引入自定义的scss */\n/**\n * Web唐明明\n * 匆匆数载恍如梦,岁月迢迢华发增。\n * 碌碌无为枉半生,一朝惊醒万事空。\n */.ios-bottom[data-v-7ea52cb9]{padding-bottom:env(safe-area-inset-bottom);padding-bottom:constant(safe-area-inset-bottom)}.ios-left[data-v-7ea52cb9]{padding-left:env(safe-area-inset-left);padding-left:constant(safe-area-inset-left)}.ios-right[data-v-7ea52cb9]{padding-right:env(safe-area-inset-right);padding-right:constant(safe-area-inset-right)}.ios-top[data-v-7ea52cb9]{padding-top:0}.vertical[data-v-7ea52cb9]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-pack:center}.nowrap[data-v-7ea52cb9]{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ellipsis[data-v-7ea52cb9]{max-width:100%;display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2}\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.content[data-v-7ea52cb9]{overflow:hidden;background:#f3f4f6;padding:%?20?%;box-sizing:border-box}.While[data-v-7ea52cb9]{border-radius:%?10?%;margin-bottom:%?30?%;background-color:#fff;padding:%?30?%;box-sizing:border-box;box-shadow:0 0 %?10?% rgba(0,0,0,.05)}.foods[data-v-7ea52cb9]{position:relative}.foods .foods-img[data-v-7ea52cb9]{width:%?100?%;height:%?100?%;border-radius:%?10?%}.foods .foods-cont[data-v-7ea52cb9]{position:absolute;width:100%;top:0;left:0;padding:%?30?% %?30?% %?30?% %?150?%;box-sizing:border-box}.foods .foods-cont .foods-name[data-v-7ea52cb9]{font-weight:600;margin-bottom:%?20?%}.foods .foods-cont .foods-text[data-v-7ea52cb9]{font-size:%?26?%;color:#919191}.levels .levels-name[data-v-7ea52cb9]{font-size:%?28?%;color:#919191;text-align:center}.levels .levels-tips[data-v-7ea52cb9]{background:linear-gradient(270deg,#6d79ec,#8591ff);color:#fff;padding:%?20?% %?20?% %?20?% %?40?%;box-sizing:border-box;border-radius:%?10?%;margin:%?30?% %?100?%;display:flex}.levels .levels-tips .levels-number[data-v-7ea52cb9]{font-size:%?60?%;margin-right:%?30?%}.levels .levels-tips .levels-text[data-v-7ea52cb9]{font-size:%?26?%;padding-top:%?8?%}.levels .levels-tips .levels-text .levels-usable[data-v-7ea52cb9]{font-size:%?24?%;opacity:.9}.levels .line[data-v-7ea52cb9]{display:flex;padding:0 %?30?%;box-sizing:border-box}.levels .line .line-label[data-v-7ea52cb9]{flex:3;margin:0 %?5?%;text-align:center;position:relative;padding-bottom:%?20?%;font-size:%?24?%;color:#919191}.levels .line .line-label[data-v-7ea52cb9]::after, .levels .line .line-label[data-v-7ea52cb9]::before{position:absolute;content:""}.levels .line .line-label[data-v-7ea52cb9]::after{left:0;bottom:0;border-radius:%?10?%;width:100%;height:%?6?%}.levels .line .line-label[data-v-7ea52cb9]::before{left:calc(50% - %?8?%);bottom:%?-6?%;z-index:9;width:%?8?%;height:%?8?%;border-radius:50%;background:#fff9ee;border-style:solid;border-width:%?6?%;display:none}.levels .line .line-label.active[data-v-7ea52cb9]::before{display:block}.levels .line .line-label[data-v-7ea52cb9]:nth-child(1)::after{background:#5dcd7b}.levels .line .line-label[data-v-7ea52cb9]:nth-child(2)::after{background:#e9ce49}.levels .line .line-label[data-v-7ea52cb9]:nth-child(3)::after{background:#f58054}.levels .line .line-label[data-v-7ea52cb9]:nth-child(1)::before{border-color:#5dcd7b}.levels .line .line-label[data-v-7ea52cb9]:nth-child(2)::before{border-color:#e9ce49}.levels .line .line-label[data-v-7ea52cb9]:nth-child(3)::before{border-color:#f58054}.levels .tips[data-v-7ea52cb9]{text-align:center;padding-top:%?20?%;font-size:%?26?%;color:#919191}.vote .vote-title[data-v-7ea52cb9]{font-size:%?26?%;color:#919191}.vote .vote-title uni-text[data-v-7ea52cb9]{color:#000;display:block;font-size:%?32?%;margin-bottom:%?10?%}.vote .vote-number[data-v-7ea52cb9]{display:flex;margin:%?40?% 0}.vote .vote-number .vote-label[data-v-7ea52cb9]{flex:3;text-align:center}.vote .vote-number .vote-label .vote-number-ticket[data-v-7ea52cb9]{color:#6d79ec;font-weight:600}.vote .vote-number .vote-label .vote-number-name[data-v-7ea52cb9]{font-size:%?28?%;margin-top:%?10?%}.vote .vote-assess[data-v-7ea52cb9]{margin-bottom:%?30?%;font-weight:600}.vote .vote-btn[data-v-7ea52cb9]{display:flex}.vote .vote-btn .vote-btn-label[data-v-7ea52cb9]{flex:3;margin:0 %?10?%;background-color:#f3f4f6;color:#262729;border-radius:%?30?%;height:%?64?%;line-height:%?64?%;font-size:%?28?%;display:flex}.vote .vote-btn .vote-btn-label .vote-label-icon[data-v-7ea52cb9]{width:%?40?%;height:%?40?%;margin:%?10?% %?15?% 0 %?20?%}.vote .vote-btn .vote-btn-label.active[data-v-7ea52cb9]{background-color:#a2aaff;color:#fff}.other .other-title[data-v-7ea52cb9]{margin-bottom:%?30?%;font-weight:600}.other .other-list[data-v-7ea52cb9]{display:flex}.other .other-list .other-label[data-v-7ea52cb9]{flex:5;text-align:center;width:20%;font-size:%?26?%}.other .other-list .other-label .other-number[data-v-7ea52cb9]{font-size:%?24?%;color:#919191;padding-top:%?10?%}.evaluate[data-v-7ea52cb9]{line-height:%?42?%;color:#585858;font-size:%?26?%}',""]),e.exports=t},c1c4:function(e,t,a){"use strict";var o;a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return o}));var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",{staticClass:"content"},[a("v-uni-view",{staticClass:"While foods"},[a("v-uni-image",{staticClass:"foods-img",attrs:{src:e.foodData.cover,mode:"aspectFill"}}),a("v-uni-view",{staticClass:"foods-cont"},[a("v-uni-view",{staticClass:"foods-name"},[e._v(e._s(e.foodData.name))]),a("v-uni-view",{staticClass:"foods-text"},[e._v(e._s(e.foodData.explain))])],1)],1),a("v-uni-view",{staticClass:"While levels"},[a("v-uni-view",{staticClass:"levels-name"},[e._v("嘌呤含量")]),a("v-uni-view",{staticClass:"levels-tips"},[a("v-uni-view",{staticClass:"levels-number"},[e._v(e._s(e.foodData.number))]),a("v-uni-view",{staticClass:"levels-text"},[a("v-uni-view",{staticClass:"levels-unit"},[e._v("毫克")]),a("v-uni-view",{staticClass:"levels-usable"},[e._v("每100克(可食部分)")])],1)],1),a("v-uni-view",{staticClass:"line"},e._l(e.count.options,(function(t,o){return a("v-uni-view",{key:o,staticClass:"line-label",class:{active:e.orderId==t.order}},[e._v(e._s(t.name))])})),1),a("v-uni-view",{staticClass:"tips"},[1==e.orderId?[e._v("( 该食物可放心食用 )")]:2==e.orderId?[e._v("( 该食物可少量食用 )")]:[e._v("( 该食物谨慎食用 )")]],2)],1),a("v-uni-view",{staticClass:"While vote"},[a("v-uni-view",{staticClass:"vote-title"},[a("v-uni-text",[e._v("一共有"+e._s(e.count.vote_users)+"位痛友参与投票")]),e._v("每个人体质不同,食物对身体的影响也会有差异!")],1),a("v-uni-view",{staticClass:"vote-number"},e._l(e.count.options,(function(t,o){return a("v-uni-view",{key:o,staticClass:"vote-label"},[a("v-uni-view",{staticClass:"vote-number-ticket"},[e._v(e._s(t.count))]),a("v-uni-view",{staticClass:"vote-number-name"},[e._v(e._s(t.name))])],1)})),1),a("v-uni-view",{staticClass:"vote-assess"},[e._v("你吃了吗怎么样?")]),a("v-uni-view",{staticClass:"vote-btn"},e._l(e.count.options,(function(t,o){return a("v-uni-view",{key:o,staticClass:"vote-btn-label",class:{active:t.is_my_vote},on:{click:function(a){arguments[0]=a=e.$handleEvent(a),e.voteClick(t.id)}}},[1==t.order?a("v-uni-image",{staticClass:"vote-label-icon",attrs:{src:"/static/icons/lookIcon_00.png",mode:""}}):2==t.order?a("v-uni-image",{staticClass:"vote-label-icon",attrs:{src:"/static/icons/lookIcon_01.png",mode:""}}):a("v-uni-image",{staticClass:"vote-label-icon",attrs:{src:"/static/icons/lookIcon_02.png",mode:""}}),a("v-uni-view",{staticClass:"vote-label-name"},[e._v(e._s(t.name))])],1)})),1)],1),a("v-uni-view",{staticClass:"While other"},[a("v-uni-view",{staticClass:"other-title"},[e._v("其他营养含量")]),e.foodData.pabulum?a("v-uni-view",{staticClass:"other-list"},[a("v-uni-view",{staticClass:"other-label"},[a("v-uni-view",{staticClass:"other-name"},[e._v("脂肪")]),a("v-uni-view",{staticClass:"other-number"},[e._v(e._s(e.foodData.pabulum.fat?e.foodData.pabulum.fat:0)+"g")])],1),a("v-uni-view",{staticClass:"other-label"},[a("v-uni-view",{staticClass:"other-name"},[e._v("碳水")]),a("v-uni-view",{staticClass:"other-number"},[e._v(e._s(e.foodData.pabulum.carbohydrate?e.foodData.pabulum.carbohydrate:0)+"g")])],1),a("v-uni-view",{staticClass:"other-label"},[a("v-uni-view",{staticClass:"other-name"},[e._v("蛋白质")]),a("v-uni-view",{staticClass:"other-number"},[e._v(e._s(e.foodData.pabulum.protein?e.foodData.pabulum.protein:0)+"g")])],1),a("v-uni-view",{staticClass:"other-label"},[a("v-uni-view",{staticClass:"other-name"},[e._v("纤维素")]),a("v-uni-view",{staticClass:"other-number"},[e._v(e._s(e.foodData.pabulum.cellulose?e.foodData.pabulum.cellulose:0)+"g")])],1),a("v-uni-view",{staticClass:"other-label"},[a("v-uni-view",{staticClass:"other-name"},[e._v("热量")]),a("v-uni-view",{staticClass:"other-number"},[e._v(e._s(e.foodData.pabulum.calories?e.foodData.pabulum.calories:0)+"kcal")])],1)],1):e._e()],1),a("v-uni-view",{staticClass:"While other"},[a("v-uni-view",{staticClass:"other-title"},[e._v("食物评价")]),a("v-uni-view",{staticClass:"evaluate"},[e._v(e._s(e.foodData.description))])],1),a("v-uni-view",{staticClass:"While other"},[a("v-uni-view",{staticClass:"other-title"},[e._v("痛风患者怎么吃")]),a("v-uni-view",{staticClass:"evaluate"},[e._v(e._s(e.foodData.remark))])],1)],1)},n=[]},e36a:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.foodVote=t.foodDet=t.foodList=t.allLogs=t.DelLog=t.DetLog=t.ListLog=t.AddlastLog=t.lastLog=t.goutCover=t.goutSee=t.goutAdd=t.goutCreate=void 0;var o=a("2981"),i=function(){return(0,o.request)({url:"gout/result/create"})};t.goutCreate=i;var n=function(e){return(0,o.request)({url:"gout/result",method:"POST",data:e})};t.goutAdd=n;var s=function(){return(0,o.request)({url:"gout/result"})};t.goutSee=s;var l=function(e,t){return(0,o.request)({url:"gout/result/"+e+"/add_cover",method:"POST",data:t})};t.goutCover=l;var r=function(e){return(0,o.request)({url:"gout/result/last_log",data:{type:e}})};t.lastLog=r;var u=function(e,t){return console.log(e),console.log(t),(0,o.request)({url:"gout/result/"+e+"/logs",method:"POST",data:t})};t.AddlastLog=u;var c=function(e,t){return(0,o.request)({url:"gout/result/"+e+"/logs",data:t})};t.ListLog=c;var v=function(e){return(0,o.request)({url:"gout/result/logs/"+e})};t.DetLog=v;var d=function(e){return(0,o.request)({url:"gout/result/logs/"+e,method:"DELETE"})};t.DelLog=d;var f=function(e){return(0,o.request)({url:"gout/result/all_logs",data:e})};t.allLogs=f;var b=function(e){return(0,o.request)({url:"gout/food",data:e})};t.foodList=b;var h=function(e){return(0,o.request)({url:"gout/food/"+e},!0)};t.foodDet=h;var g=function(e,t){return(0,o.request)({url:"gout/food/"+e+"/"+t,method:"POST"})};t.foodVote=g}}]); |