123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- {include file="../application/h5/view/wx_book_dinner/header.html"}
- <style>
- .weui-form-preview-hd {
- padding: 0 15px;
- position: relative;
- text-align: right;
- }
- .pull-right{
- float: right!important;
- }
- .text-muted{
- color: #888888;
- }
- </style>
- <div class="weui-header bg-blue">
- <div class="weui-header-left"> <a class="icon icon-109 f-white" href="{:url('tc')}">返回</a> </div>
- <h1 class="weui-header-title">订单详情</h1>
- <div class="weui-header-right"></div>
- </div>
- <form id="form" action="{:url('submitorder2')}" enctype="multipart/form-data" method="post" class="ajax-form-order">
- <div class="weui_cells_title">所属机构</div>
- <div class="weui_cells">
- <div class="weui_cell" style="background-color: #ccc;">
- <div class="weui_cell_bd weui_cell_primary">
- <div class="weui_input" type="readonly" >{$HospitalName}</div>
- </div>
- </div>
- </div>
- <div class="weui_cells_title">联系方式</div>
- <div class="weui_cells weui_cells_form">
- <div class="weui_cell">
- <div class="weui_cell_hd"><label class="weui_label">姓名<i style="color:red;">*</i></label></div>
- <div class="weui_cell_bd weui_cell_primary">
- <input class="weui_input" name="name" type="text" value="{$name}" placeholder="请输入姓名">
- </div>
- </div>
- <div class="weui_cell">
- <div class="weui_cell_hd"><label class="weui_label">手机号<i style="color:red;">*</i></label></div>
- <div class="weui_cell_bd weui_cell_primary">
- <input class="weui_input" type="number" name='mobile' value="{$phone}" pattern="[0-9]*" placeholder="请输入号码">
- </div>
- </div>
- </div>
- <div class="weui_cells_title">收货地址<i style="color:red;">*</i></div>
- <div class="weui_cells">
- <div class="weui_cell">
- <div class="weui_cell_bd weui_cell_primary">
- <textarea id="textarea" readonly class="weui_textarea" name="address" placeholder="请输入“{$HospitalName}”里的具体位置" rows="3">{$address}</textarea>
- </div>
- </div>
- </div>
- <div class="weui_cells_title">床号及备注<i style="color:red;">*</i></div>
- <div class="weui_cells">
- <div class="weui_cell">
- <div class="weui_cell_bd weui_cell_primary">
- <textarea id="textarea" class="weui_textarea" name="remark" placeholder="请输入床号及备注信息(最多15字)" rows="3"></textarea>
- </div>
- </div>
- </div>
- <div id="vueapp">
- <input type="hidden" name="goods" id="goods">
- <div v-for="(item,index) in lists" :key="index">
- <div class="weui_cells_title">{{item.day}} {{item.group}} ¥{{item.money}}</div>
- <div class="weui_cells weui_cells_form">
- <div v-for="(item2,index2) in item.dinners" :key="index2" class="weui_cell text-muted">
- [{{item2.dinner_type_name}}] {{item2.name}} ¥{{item2.money}}*{{item2.nums}}
- </div>
- </div>
- </div>
- <div v-if="type == 1" class="weui_cells_title">上传医嘱<i style="color:red;">*</i></div>
- <div v-if="type == 1" class="weui_cells">
- <div class="weui_cell">
- <div class="weui_cell_bd weui_cell_primary">
- <input class="weui_input" style="height: auto!important;" type="file" accept="image/png,image/jpeg" name="files">
- </div>
- </div>
- </div>
- </div>
- <div class="weui_btn_area">
- <button type="submit" class="weui_btn weui_btn_primary">提交订单</button>
- </div>
- <div style="height: 30px;"/>
- </form>
- <script src="/static/elementui2.15.5/vue-2.6.14.js"></script>
- <script>
- var vm = new Vue({
- el: '#vueapp',
- data: {
- type: 0, // 0=普通餐 1=含流食
- lists:[]
- },
- created: function () {
- let lists = localStorage.getItem('userdinners');
- if(!lists){
- $.toptips("未选择菜品",'warning');
- return false;
- }
- let dinners = JSON.parse(lists);
- console.log('dinners',dinners);
- let selected = [];
- let ids = [];
- dinners.forEach((item) => {
- if(item.count > 0){
- let ll = [];
- item.types.forEach((item2) => {
- item2.dinners.forEach((item3) => {
- if(item3.nums > 0){
- if(item3.type == 1){
- this.type = 1;
- }
- ids.push({id:item3.id,nums:item3.nums});
- ll.push({
- id: item3.id,
- name: item3.name,
- imgs: item3.imgs,
- money: item3.money,
- nums: item3.nums,
- dinner_type_id: item3.dinner_type_id,
- dinner_type_name: item2.name,
- })
- }
- });
- });
- selected.push({
- count: item.count,
- day: item.day,
- money: item.money,
- group: item.group,
- text: item.text,
- dinners: JSON.parse(JSON.stringify(ll))
- })
- }
- });
- this.lists = JSON.parse(JSON.stringify(selected));
- $('#goods').val(JSON.stringify(ids));
- console.log('dinners',dinners,selected);
- },
- methods: {
- },
- });
- </script>
- <script type="text/javascript">
- $(document).ready(function () {
- //提交数据
- // $('.ajax-form-order').ajaxSubmit(function(result){
- // if(result.code ==1){
- // $.toptips(result.message,'warning');
- // }else{
- // window.location.href = result.url;
- // }
- // return false;
- // });
- });
- function add() {
- $.post('submitorder',$('.ajax-form-order').serialize(),function (result) {
- if(result.code ==1){
- $.toptips(result.message,'warning');
- }else{
- window.location.href = result.data.url;
- }
- },'json')
- }
- function order() {
- layer.open({
- content: '请仔细确认您的订单数量及金额。如需退单,仅可在下单当日申请,并联系餐厅人员审核,方可退款。'
- ,btn: ['确定', '取消']
- ,yes: function(index){
- layer.closeAll();
- add();
- }
- });
- }
- </script>
|