| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665 |
- <template>
- <view class="member-detail-wrap">
- <view class="member-head">会员详情</view>
- <view class="member-content">
- <view class="content-block">
- <view class="item-img">
- <image mode="aspectFill" v-if="memberInfo && memberInfo.headimg" :src="$util.img(memberInfo.headimg)" @error="headError(memberInfo)"></image>
- <image mode="aspectFill" v-else :src="$util.img(defaultImg.head)"></image>
- </view>
- <view class="item-content">
- <view class="item-title">
- <view class="item-title-text">{{ memberInfo && memberInfo.nickname ? memberInfo.nickname : '' }}</view>
- <view class="item-label" v-if="memberInfo && memberInfo.member_level && memberInfo.member_level_name != 'undefined'">
- {{ memberInfo.member_level_name }}
- </view>
- </view>
- <view class="info-list">
- <view class="info-item">手机:{{ memberInfo && memberInfo.mobile ? memberInfo.mobile : '' }}</view>
- <view class="info-item" v-if="memberInfo && memberInfo.sex == 0">性别:未知</view>
- <view class="info-item" v-if="memberInfo && memberInfo.sex == 1">性别:男</view>
- <view class="info-item" v-if="memberInfo && memberInfo.sex == 2">性别:女</view>
- <view class="info-item">生日:{{ memberInfo && memberInfo.birthday ? memberInfo.birthday : '' }}</view>
- <view class="info-item" v-if="memberInfo && memberInfo.member_time">成为会员:{{ $util.timeFormat(memberInfo.member_time) }}</view>
- </view>
- </view>
- </view>
- <view class="content-block account">
- <view class="content-data-item">
- <view class="data-item-title">积分</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.point ? parseInt(memberInfo.point) : '0' }}</view>
- <view class="data-item-action" @click="memberAction('point_list')">查看</view>
- </view>
- <view class="content-data-item">
- <view class="data-item-title">储值余额(元)</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.balance ? memberInfo.balance : '0.00' }}</view>
- <view class="data-item-action" @click="memberAction('balance_list')">查看</view>
- <!-- <view class="data-item-action" v-if="memberInfo && memberInfo.balance > 0" @click="refundBalance">退储值</view> -->
- </view>
- <view class="content-data-item">
- <view class="data-item-title">现金余额(元)</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.balance_money ? memberInfo.balance_money : '0.00' }}</view>
- </view>
- <view class="content-data-item">
- <view class="data-item-title">成长值</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.growth ? memberInfo.growth : '0' }}</view>
- <view class="data-item-action" @click="memberAction('growth_list')">查看</view>
- </view>
- <view class="content-data-item">
- <view class="data-item-title">优惠券(张)</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.coupon_num ? memberInfo.coupon_num : '0' }}</view>
- <view class="data-item-action" @click="memberAction('couponlist')">查看</view>
- </view>
- <view class="content-data-item">
- <view class="data-item-title">卡包</view>
- <view class="data-item-value">{{ memberInfo && memberInfo.card_num ? memberInfo.card_num : '0' }}</view>
- <view class="data-item-action" @click="memberAction('cardlist')">查看</view>
- </view>
- </view>
- <view class="content-block action">
- <view class="content-data-item">
- <view class="data-item-icon">
- <image mode="aspectFit" @click="memberAction('memberinfo')" :src="$util.img('public/uniapp/cashier/icon-member-info.png')"></image>
- </view>
- <view class="data-item-value">会员信息</view>
- </view>
- <view class="content-data-item" @click="memberAction('point')">
- <view class="data-item-icon"><image mode="aspectFit" :src="$util.img('public/uniapp/cashier/icon-member-point.png')"></image></view>
- <view class="data-item-value">积分调整</view>
- </view>
- <view class="content-data-item" @click="memberAction('balance')">
- <view class="data-item-icon"><image mode="aspectFit" :src="$util.img('public/uniapp/cashier/icon-member-balance.png')"></image></view>
- <view class="data-item-value">余额充值</view>
- </view>
- <view class="content-data-item" @click="memberAction('sendCoupon')">
- <view class="data-item-icon"><image mode="aspectFit" :src="$util.img('public/uniapp/cashier/icon-member-coupon.png')"></image></view>
- <view class="data-item-value">送优惠券</view>
- </view>
- <view class="content-data-item" @click="memberAction('growth')">
- <view class="data-item-icon"><image mode="aspectFit" :src="$util.img('public/uniapp/cashier/icon-member-growth.png')"></image></view>
- <view class="data-item-value">成长值调整</view>
- </view>
- <view class="content-data-item" @click="memberAction('applyMember')" v-if="memberInfo && !memberInfo.is_member">
- <view class="data-item-icon"><image mode="aspectFit" :src="$util.img('public/uniapp/cashier/icon-member-apply.png')"></image></view>
- <view class="data-item-value">办理会员</view>
- </view>
- </view>
- </view>
- <!-- 会员详情 -->
- <uni-popup ref="memberInfoPop">
- <view class="pop-box memberInfo-box">
- <view class="pop-header">
- <view class="pop-header-text">会员详情</view>
- <view class="pop-header-close" @click="popClose('memberinfo')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <view class="form-content" v-if="memberInfo">
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 昵称:
- </view>
- <view class="form-inline"><input class="form-input" placeholder="请输入会员昵称" v-model="memberInfo.nickname" /></view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 手机号:
- </view>
- <view class="form-inline"><input class="form-input " placeholder="请输入手机号" v-model="memberInfo.mobile" /></view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 会员等级:
- </view>
- <view class="form-inline">
- <select-lay
- :zindex="10"
- :value="memberInfo.member_level"
- name="names"
- placeholder="请选择会员等级"
- :options="memberLevelList"
- @selectitem="selectMemberLevel"
- ></select-lay>
- </view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 性别:
- </view>
- <view class="form-inline"><uni-data-checkbox v-model="memberInfo.sex" selectedColor="#8558FA" :localdata="sex"></uni-data-checkbox></view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 生日:
- </view>
- <view class="form-inline"><uni-datetime-picker :end="endTime" v-model="memberInfo.birthday" type="date" :clearIcon="false" /></view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 注册时间:
- </view>
- <view class="form-inline">{{ memberInfo && memberInfo.reg_time ? $util.timeFormat(memberInfo.reg_time) : '--' }}</view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 最后访问时间:
- </view>
- <view class="form-inline">{{ memberInfo && memberInfo.last_login_time ? $util.timeFormat(memberInfo.last_login_time) : '--' }}</view>
- </view>
- </view>
- </scroll-view>
- <view class="pop-bottom"><button class="primary-btn" @click="saveMemberInfo">确定</button></view>
- </view>
- </uni-popup>
- <!-- 积分调整 -->
- <uni-popup ref="pointPop">
- <view class="pop-box pointPop-box">
- <view class="pop-header">
- <view class="pop-header-text">调整积分</view>
- <view class="pop-header-close" @click="popClose('point')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <view class="form-content">
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 当前积分:
- </view>
- <view class="form-inline">{{ memberInfo && memberInfo.point ? memberInfo.point : '0' }}</view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 调整数额:
- </view>
- <view class="form-inline">
- <input class="form-input" type="number" placeholder="请输入调整数额" v-model="pointData.num" />
- <view class="word-aux">调整数额与当前积分数相加不能小于0</view>
- </view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 备注:
- </view>
- <view class="form-inline"><textarea class="form-textarea" v-model="pointData.desc"></textarea></view>
- </view>
- </view>
- </scroll-view>
- <view class="pop-bottom"><button class="primary-btn" @click="savePoint">确定</button></view>
- </view>
- </uni-popup>
- <!-- 发放优惠券 -->
- <uni-popup ref="sendCouponPop">
- <view class="pop-box sendCoupon-box">
- <view class="pop-header">
- <view class="pop-header-text">送优惠券</view>
- <view class="pop-header-close" @click="popClose('sendCoupon')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <view class="common-scrollbar sendCoupon-content">
- <view class="coupon-table-head">
- <view class="coupon-table-th">优惠券名称</view>
- <view class="coupon-table-th">金额</view>
- <view class="coupon-table-th">有效期</view>
- <view class="coupon-table-th">发放数量</view>
- </view>
- <scroll-view class="coupon-table-body" @scrolltolower="getCouponList()" scroll-y="true">
- <view class="coupon-table-tr" v-for="(item, index) in sendCoupon.list" :key="index">
- <view class="coupon-table-td">{{ item.coupon_name }}</view>
- <view class="coupon-table-td">{{ item.money }}</view>
- <view class="coupon-table-td">{{ item.validity_name }}</view>
- <view class="coupon-table-td">
- <view class="item-num">
- <view class="num-dec" v-on:click="dec(item)">-</view>
- <input class="table-input" type="text" v-model="item.num" />
- <view class="num-inc" v-on:click="inc(item)">+</view>
- </view>
- </view>
- </view>
- <view class="empty" v-if="!sendCoupon.list.length">
- <view class="iconfont iconwushuju"></view>
- <view>暂无数据</view>
- </view>
- </scroll-view>
- </view>
- <view class="pop-bottom ">
- <button :class="[sendCoupon.list.length ? 'primary-btn' : 'default-btn']" @click="sendCouponFn">
- {{ sendCoupon.list.length ? '发放优惠券' : '暂无优惠券' }}
- </button>
- </view>
- </view>
- </uni-popup>
- <!-- 余额调整 -->
- <uni-popup ref="balancePop">
- <view class="pop-box pointPop-box">
- <view class="pop-header">
- <view class="pop-header-text">调整余额</view>
- <view class="pop-header-close" @click="popClose('balance')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <view class="form-content">
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 当前余额:
- </view>
- <view class="form-inline">{{ memberInfo && memberInfo.balance ? memberInfo.balance : '0.00' }}</view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 调整数额:
- </view>
- <view class="form-inline">
- <input class="form-input" type="number" placeholder="请输入调整数额" v-model="balanceData.num" />
- <view class="word-aux">调整数额与当前储值余额相加不能小于0</view>
- </view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 备注:
- </view>
- <view class="form-inline"><textarea class="form-textarea" v-model="balanceData.desc"></textarea></view>
- </view>
- </view>
- </scroll-view>
- <view class="pop-bottom"><button class="primary-btn" @click="saveBalance">确定</button></view>
- </view>
- </uni-popup>
- <!-- 成长值调整 -->
- <uni-popup ref="growthPop">
- <view class="pop-box pointPop-box">
- <view class="pop-header">
- <view class="pop-header-text">调整成长值</view>
- <view class="pop-header-close" @click="popClose('growth')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <view class="form-content">
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 当前成长值:
- </view>
- <view class="form-inline">{{ memberInfo && memberInfo.growth ? memberInfo.growth : '0' }}</view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 调整数额:
- </view>
- <view class="form-inline">
- <input class="form-input" type="number" placeholder="请输入调整数额" v-model="growthData.num" />
- <view class="word-aux">调整数额与当前成长值相加不能小于0</view>
- </view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 备注:
- </view>
- <view class="form-inline"><textarea class="form-textarea" v-model="growthData.desc"></textarea></view>
- </view>
- </view>
- </scroll-view>
- <view class="pop-bottom"><button class="primary-btn" @click="saveGrowth">确定</button></view>
- </view>
- </uni-popup>
- <!-- 办理会员 -->
- <uni-popup ref="applyMemberPop">
- <view class="pop-box applyMemberPop-box">
- <view class="pop-header">
- <view class="pop-header-text">办理会员</view>
- <view class="pop-header-close" @click="popClose('applyMember')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <view class="common-scrollbar pop-content">
- <view class="form-content">
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 会员等级:
- </view>
- <view class="form-inline">
- <select-lay
- :zindex="10"
- :value="applyMember.level_id"
- name="names"
- placeholder="请选择会员等级"
- :options="memberLevelList"
- @selectitem="selectMemberLevel"
- ></select-lay>
- </view>
- </view>
- <view class="form-item">
- <view class="form-label">
- <text class="required"></text>
- 会员卡号:
- </view>
- <view class="form-inline">
- <input class="form-input" type="text" placeholder="请输入会员卡号" v-model="applyMember.member_code" />
- <view class="word-aux">会员卡号为会员唯一编号,若不设置将会自动生成</view>
- </view>
- </view>
- </view>
- </view>
- <view class="pop-bottom"><button class="primary-btn" @click="saveApplyMember">确定</button></view>
- </view>
- </uni-popup>
- <!-- 优惠券列表 -->
- <uni-popup ref="couponlistPop">
- <view class="pop-box couponlistPop-box">
- <view class="pop-header">
- <view class="pop-header-text">优惠券</view>
- <view class="pop-header-close" @click="popClose('couponlist')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <dataTable url="/cashier/storeapi/member/coupon" :cols="couponcols" ref="table" :option="option" :pagesize="pagesize"></dataTable>
- </scroll-view>
- </view>
- </uni-popup>
- <uni-popup ref="refundBalance">
- <view class="pop-box refund-balance-box">
- <view class="pop-header">
- <view class="pop-header-text">退储值</view>
- <view class="pop-header-close" @click="$refs.refundBalance.close()"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <view class="pop-content" v-if="refundData">
- <view class="info-item">
- <view class="title">账户可用储值:</view>
- <view class="data">¥{{ $util.moneyFormat(parseFloat(refundData.member_account.balance) + parseFloat(refundData.member_account.balance_money)) }}</view>
- </view>
- <view class="info-item">
- <view class="title">实充储值:</view>
- <view class="data">¥{{ refundData.refund_total_balance | moneyFormat }}</view>
- </view>
- <view class="info-item">
- <view class="title">已使用储值:</view>
- <view class="data">¥{{ refundData.use_total_balance | moneyFormat }}</view>
- </view>
- <view class="info-item">
- <view class="title">可退储值金额:</view>
- <view class="data">¥{{ refundData.can_refund_balance | moneyFormat }}</view>
- </view>
- <view class="info-item">
- <view class="title">退还金额:</view>
- <view class="data"><input type="number" value="" v-model="refundData.refund_balance" /></view>
- </view>
- <view class="info-item">
- <view class="title">退款方式:</view>
- <view class="data refund-type">
- <view
- class="value-item"
- :class="{ active: index == refundTransferType }"
- @click="refundTransferType = index"
- v-for="(item, index) in refundTransferTypeList"
- :key="index"
- >
- {{ item.name }}
- </view>
- </view>
- </view>
- </view>
- <view class="pop-bottom">
- <button class="primary-btn" @click="confirmRefundBalance">确定</button>
- <button class="default-btn" @click="$refs.refundBalance.close()">取消</button>
- </view>
- </view>
- </uni-popup>
- <!-- 积分列表 -->
- <uni-popup ref="pointListPop">
- <view class="pop-box couponlistPop-box">
- <view class="pop-header">
- <view class="pop-header-text">积分</view>
- <view class="pop-header-close" @click="popClose('point_list')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <dataTable url="/cashier/storeapi/member/memberaccountlist" :cols="pointCols" ref="table" :option="option" :pagesize="pagesize"></dataTable>
- </scroll-view>
- </view>
- </uni-popup>
- <!-- 余额列表 -->
- <uni-popup ref="balanceListPop">
- <view class="pop-box couponlistPop-box">
- <view class="pop-header">
- <view class="pop-header-text">余额</view>
- <view class="pop-header-close" @click="popClose('balance_list')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <dataTable url="/cashier/storeapi/member/memberaccountlist" :cols="balanceCols" ref="table" :option="option" :pagesize="pagesize"></dataTable>
- </scroll-view>
- </view>
- </uni-popup>
- <!-- 成长值列表 -->
- <uni-popup ref="growthListPop">
- <view class="pop-box couponlistPop-box">
- <view class="pop-header">
- <view class="pop-header-text">成长值</view>
- <view class="pop-header-close" @click="popClose('growth_list')"><i class="iconguanbi1 iconfont"></i></view>
- </view>
- <scroll-view scroll-y="true" class="common-scrollbar pop-content">
- <dataTable url="/cashier/storeapi/member/memberaccountlist" :cols="growthCols" ref="table" :option="option" :pagesize="pagesize"></dataTable>
- </scroll-view>
- </view>
- </uni-popup>
- <!-- 卡项 -->
- <nc-member-card ref="memberCard" :option="option"></nc-member-card>
- </view>
- </template>
- <script>
- import dataTable from '@/components/uni-data-table/uni-data-table.vue';
- export default {
- components: {
- dataTable
- },
- props: {
- memberId: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- memberList: [],
- pagesize: 8,
- endTime: '',
- sex: [
- {
- text: '未知',
- value: 0
- },
- {
- text: '男',
- value: 1
- },
- {
- text: '女',
- value: 2
- }
- ],
- pointData: {
- num: 0,
- desc: ''
- },
- growthData: {
- num: 0,
- desc: ''
- },
- balanceData: {
- num: 0,
- desc: ''
- },
- couponcols: [
- {
- width: 15,
- title: '优惠券名称',
- align: 'left',
- field: 'coupon_name'
- },
- {
- width: 10,
- title: '类型',
- align: 'left',
- templet: function(data) {
- if (data.type == 'reward') return '满减';
- if (data.type == 'discount') return '折扣';
- }
- },
- {
- width: 20,
- title: '优惠金额',
- align: 'left',
- templet: function(data) {
- if (data.type == 'reward') {
- var html = `满${data.at_least}元减${data.money}`;
- return `<view title="${html}">${html}</view>`;
- }
- if (data.type == 'discount') {
- var text = '满' + data.at_least + '元打' + data.discount + '折';
- if (data.discount_limit) text += '(最多抵扣' + data.discount_limit + '元)';
- return '<view title="' + text + '">' + text + '</view>';
- }
- }
- },
- {
- width: 20,
- title: '有效期',
- align: 'center',
- templet: data => {
- if (data.end_time) return this.$util.timeFormat(data.end_time);
- else return '长期有效';
- }
- },
- {
- width: 15,
- title: '状态',
- align: 'center',
- return: data => {
- if (data.state == 1) return '未使用';
- if (data.state == 2) return '已使用';
- if (data.state == 3) return '已过期';
- }
- },
- {
- width: 20,
- title: '领取时间',
- align: 'right',
- templet: data => {
- return this.$util.timeFormat(data.fetch_time);
- }
- }
- ],
- pointCols: [
- {
- width: 20,
- title: '积分',
- align: 'left',
- field: 'account_data'
- },
- {
- width: 25,
- title: '发生方式',
- align: 'left',
- field: 'type_name'
- },
- {
- width: 25,
- title: '发生时间',
- align: 'left',
- templet: data => {
- var html = this.$util.timeFormat(data.create_time);
- return html;
- }
- },
- {
- width: 30,
- title: '备注',
- align: 'left',
- field: 'remark'
- }
- ],
- balanceCols: [
- {
- width: 10,
- title: '账户类型',
- align: 'left',
- field: 'account_type_name'
- },
- {
- width: 15,
- title: '余额',
- align: 'left',
- field: 'account_data'
- },
- {
- width: 20,
- title: '发生方式',
- align: 'left',
- field: 'type_name'
- },
- {
- width: 25,
- title: '发生时间',
- align: 'left',
- templet: data => {
- var html = this.$util.timeFormat(data.create_time);
- return html;
- }
- },
- {
- width: 30,
- title: '备注',
- align: 'left',
- field: 'remark'
- }
- ],
- growthCols: [
- {
- width: 20,
- title: '成长值',
- align: 'left',
- field: 'account_data'
- },
- {
- width: 25,
- title: '发生方式',
- align: 'left',
- field: 'type_name'
- },
- {
- width: 25,
- title: '发生时间',
- align: 'left',
- templet: data => {
- var html = this.$util.timeFormat(data.create_time);
- return html;
- }
- },
- {
- width: 30,
- title: '备注',
- align: 'left',
- field: 'remark'
- }
- ],
- option: {},
- addMemberData: {
- mobile: '',
- nickname: '',
- sex: 0,
- birthday: ''
- },
- refundTransferTypeList: {},
- refundTransferType: '',
- refundData: null,
- isRepeat: false,
- sendCoupon: {
- list: [],
- page: 1
- },
- memberLevelList: [],
- applyMember: {
- level_id: '',
- member_level_name: '',
- member_code: ''
- }
- };
- },
- created() {
- this.getMemberInfo();
- this.getMemberLevel();
- let date = new Date();
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- var d = date.getDate();
- this.endTime = y + '-' + m + '-' + d;
- },
- watch: {
- memberId: function() {
- this.getMemberInfo();
- }
- },
- methods: {
- getMemberInfo() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/info',
- data: {
- member_id: this.memberId
- },
- success: res => {
- if (res.code >= 0) {
- res.data.birthday = res.data.birthday > 0 ? this.$util.timeFormat(res.data.birthday, 'y-m-d') : '';
- this.$store.commit('setMemberInfo', res.data);
- }
- }
- });
- },
- getMemberLevel() {
- this.memberLevelList = [];
- this.$api.sendRequest({
- url: '/cashier/storeapi/memberlevel/lists',
- success: res => {
- if (res.code == 0 && res.data) {
- for (let i in res.data) {
- this.memberLevelList.push({
- label: res.data[i]['level_name'],
- value: res.data[i]['level_id'].toString(),
- disabled: false
- });
- }
- }
- }
- });
- },
- selectMemberLevel(index, item) {
- if (index >= 0) {
- this.applyMember.level_id = item.value;
- this.memberInfo.member_level = item.value;
- this.applyMember.member_level_name = item.label;
- } else {
- this.applyMember.level_id = '';
- this.memberInfo.level_id = '';
- this.applyMember.member_level_name = '';
- }
- this.$forceUpdate();
- },
- verify() {
- if (!this.addMemberData.mobile) {
- this.$util.showToast({
- title: '请输入客户手机号'
- });
- return false;
- }
- if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.addMemberData.mobile)) {
- this.$util.showToast({
- title: '请输入正确的手机号码'
- });
- return false;
- }
- return true;
- },
- // 客户操作
- memberAction(type) {
- switch (type) {
- case 'memberinfo':
- this.$refs.memberInfoPop.open('center');
- break;
- case 'point':
- this.$refs.pointPop.open('center');
- break;
- case 'balance':
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/info',
- data: {
- member_id: this.memberId
- },
- success: res => {
- if (res.code >= 0) {
- this.$store.commit('setMemberInfo', res.data);
- }
- if (getCurrentPages()[0].route == 'pages/recharge/index') this.$root.type = 'topUp';
- else this.$util.redirectTo('/pages/recharge/index');
- }
- });
- break;
- case 'sendCoupon':
- this.getCouponList();
- this.$refs.sendCouponPop.open('center');
- break;
- case 'growth':
- this.$refs.growthPop.open('center');
- break;
- case 'couponlist':
- this.option = {
- member_id: this.memberId
- };
- this.$refs.couponlistPop.open('center');
- break;
- case 'cardlist':
- this.option = {
- member_id: this.memberId
- };
- this.$refs.memberCard.open('center');
- break;
- case 'point_list':
- // 积分列表
- this.option = {
- member_id: this.memberId,
- account_type: 'point'
- };
- this.$refs.pointListPop.open();
- break;
- case 'balance_list':
- // 余额列表
- this.option = {
- member_id: this.memberId,
- account_type: 'balance'
- };
- this.$refs.balanceListPop.open();
- break;
- case 'growth_list':
- // 成长值列表
- this.option = {
- member_id: this.memberId,
- account_type: 'growth'
- };
- this.$refs.growthListPop.open();
- break;
- case 'applyMember':
- this.$refs.applyMemberPop.open();
- break;
- }
- },
- popClose(type) {
- switch (type) {
- case 'memberinfo':
- this.$refs.memberInfoPop.close();
- break;
- case 'point':
- this.$refs.pointPop.close();
- break;
- case 'balance':
- this.$refs.balancePop.close();
- break;
- case 'sendCoupon':
- this.$refs.sendCouponPop.close();
- break;
- case 'growth':
- this.$refs.growthPop.close();
- break;
- case 'couponlist':
- this.$refs.couponlistPop.close();
- break;
- case 'cardlist':
- this.$refs.cardlistPop.close();
- break;
- case 'point_list':
- // 积分列表
- this.$refs.pointListPop.close();
- break;
- case 'balance_list':
- // 余额列表
- this.$refs.balanceListPop.close();
- break;
- case 'growth_list':
- // 成长值列表
- this.$refs.growthListPop.close();
- break;
- case 'applyMember':
- // 办理会员
- this.$refs.applyMemberPop.close();
- break;
- }
- },
- //获取发放优惠券列表
- getCouponList() {
- let data = {
- page: this.sendCoupon.page,
- page_size: 7
- };
- this.$api.sendRequest({
- url: '/cashier/storeapi/coupon/couponTypeList',
- data: data,
- success: res => {
- if (res.code >= 0) {
- if (this.sendCoupon.page == 1) this.sendCoupon.list = [];
- if (res.data.list && res.data.list.length) {
- res.data.list.forEach((item, index) => {
- if (item.validity_type == 0) item.validity_name = '失效日期:' + this.$util.timeFormat(item.end_time);
- else if (item.validity_type == 1) item.validity_name = '领取后,' + item.fixed_term + '天有效';
- else item.validity_name = '长期有效';
- item.num = 0;
- });
- }
- this.sendCoupon.list = this.sendCoupon.list.concat(res.data.list);
- if (res.data.page_count >= this.sendCoupon.page) this.sendCoupon.page++;
- }
- }
- });
- },
- // 发放数量
- dec: function(item) {
- if (item.num > 0) {
- item.num = item.num - 1;
- }
- },
- inc: function(item) {
- item.num = item.num + 1;
- },
- // 发放优惠券
- sendCouponFn() {
- if (!this.sendCoupon.list || !this.sendCoupon.list.length) return false;
- let data = {};
- data.member_id = this.memberInfo.member_id;
- data.coupon_data = '';
- let couponDataArr = [];
- this.sendCoupon.list.forEach((item, index) => {
- if (item.num > 0) {
- let obj = {};
- obj.coupon_type_id = item.coupon_type_id;
- obj.num = item.num;
- couponDataArr.push(obj);
- }
- });
- if (couponDataArr.length <= 0) return false;
- data.coupon_data = JSON.stringify(couponDataArr);
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/sendCoupon',
- data: data,
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.sendCoupon.page = 1;
- this.sendCoupon.list = [];
- this.getMemberInfo();
- this.$refs.sendCouponPop.close();
- }
- }
- });
- },
- //修改客户信息
- saveMemberInfo() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/editmember',
- data: {
- nickname: this.memberInfo.nickname,
- sex: this.memberInfo.sex,
- birthday: this.memberInfo.birthday,
- member_id: this.memberInfo.member_id,
- mobile: this.memberInfo.mobile,
- level_id: this.memberInfo.member_level
- },
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.getMemberInfo();
- this.popClose('memberinfo');
- }
- }
- });
- },
- // 调整积分
- savePoint() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/modifypoint',
- data: {
- member_id: this.memberInfo.member_id,
- adjust_num: this.pointData.num,
- remark: this.pointData.desc
- },
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.pointData.num = 0;
- this.pointData.desc = '';
- this.getMemberInfo();
- this.popClose('point');
- }
- }
- });
- },
- // 调整余额
- saveBalance() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/modifybalance',
- data: {
- member_id: this.memberInfo.member_id,
- adjust_num: this.balanceData.num,
- remark: this.balanceData.desc
- },
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.balanceData.num = 0;
- this.balanceData.desc = '';
- this.getMemberInfo();
- this.popClose('balance');
- }
- }
- });
- },
- // 调整成长值
- saveGrowth() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/modifygrowth',
- data: {
- member_id: this.memberInfo.member_id,
- adjust_num: this.growthData.num,
- remark: this.growthData.desc
- },
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.growthData.num = 0;
- this.growthData.desc = '';
- this.getMemberInfo();
- this.popClose('growth');
- }
- }
- });
- },
- // 办理会员卡
- saveApplyMember() {
- if (!this.applyMember.level_id) {
- this.$util.showToast({
- title: '请选择会员卡等级'
- });
- return false;
- }
- this.$api.sendRequest({
- url: '/cashier/storeapi/member/handleMember',
- data: {
- member_id: this.memberInfo.member_id,
- level_id: this.applyMember.level_id,
- member_code: this.applyMember.member_code
- },
- success: res => {
- this.$util.showToast({
- title: res.message
- });
- if (res.code >= 0) {
- this.$root.page = 1;
- this.$root.search_text = 1;
- this.$root.getMemberList();
- this.popClose('applyMember');
- }
- }
- });
- },
- refundBalance() {
- this.$api.sendRequest({
- url: '/cashier/storeapi/cashierorderrefund/getMemberBalanceRefundData',
- data: {
- member_id: this.memberInfo.member_id
- },
- success: res => {
- if (res.code == 0) {
- this.refundData = res.data;
- this.refundData.refund_balance = this.$util.moneyFormat(res.data.can_refund_balance);
- this.refundTransferTypeList = res.data.refund_transfer_type_list;
- this.refundTransferType = Object.keys(res.data.refund_transfer_type_list)[0];
- this.$refs.refundBalance.open();
- } else {
- this.$util.showToast({
- title: res.message
- });
- }
- }
- });
- },
- confirmRefundBalance() {
- if (isNaN(parseFloat(this.refundData.refund_balance))) {
- this.$util.showToast({
- title: '退还金额格式错误'
- });
- return;
- }
- if (parseFloat(this.refundData.refund_balance) > parseFloat(this.refundData.can_refund_balance)) {
- this.$util.showToast({
- title: '退还金额超出最大可退金额'
- });
- return;
- }
- if (this.refundData.refund_balance <= 0) {
- this.$util.showToast({
- title: '退还金额不能小于等于0'
- });
- return;
- }
- if (this.isRepeat) return;
- this.isRepeat = true;
- this.$api.sendRequest({
- url: '/cashier/storeapi/cashierorderrefund/memberRefundBalance',
- data: {
- refund_balance: this.$util.moneyFormat(this.refundData.refund_balance),
- member_id: this.memberInfo.member_id,
- refund_transfer_type: this.refundTransferType
- },
- success: res => {
- if (res.code == 0) {
- this.$util.showToast({
- title: '储值退还成功'
- });
- this.getMemberInfo();
- this.$refs.refundBalance.close();
- } else {
- this.$util.showToast({
- title: res.message
- });
- }
- this.isRepeat = true;
- }
- });
- },
- headError(item) {
- item.headimg = this.defaultImg.head;
- }
- }
- };
- </script>
- <style lang="scss">
- .member-detail-wrap {
- width: 100%;
- border-left: 0;
- .member-head {
- height: 0.66rem;
- line-height: 0.66rem;
- box-sizing: border-box;
- border-bottom: 0.01rem solid #e6e6e6;
- font-size: 0.14rem;
- }
- .member-content {
- padding: 0.15rem;
- width: 100%;
- height: calc(100vh - 0.8rem);
- box-sizing: border-box;
- .content-block {
- width: 100%;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- .item-img {
- width: 0.7rem;
- height: 0.7rem;
- border-radius: 50%;
- box-sizing: border-box;
- image {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- .item-content {
- padding-left: 0.15rem;
- width: calc(100% - 0.7rem);
- box-sizing: border-box;
- .item-title {
- width: 100%;
- font-size: 0.16rem;
- align-items: center;
- display: flex;
- .item-label {
- border: 0.01rem solid $primary-color;
- color: $primary-color;
- background-color: #fff;
- border-radius: 0.02rem;
- width: fit-content;
- padding: 0.01rem 0.05rem;
- margin-left: 0.15rem;
- }
- .item-title-text {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- max-width: 50%;
- font-size: 0.16rem;
- }
- }
- .info-list {
- margin-top: 0.15rem;
- display: flex;
- justify-content: space-between;
- .info-item {
- font-size: 0.14rem;
- margin-right: 0.2rem;
- }
- }
- }
- }
- .content-block.account {
- border: 0.01rem solid #e6e6e6;
- background-color: #ffffff;
- padding: 0.25rem 0;
- display: flex;
- justify-content: space-around;
- margin-top: 0.2rem;
- border-radius: 0.03rem;
- align-items: baseline;
- .content-data-item {
- .data-item-title {
- }
- .data-item-value {
- font-size: 0.26rem;
- margin-top: 0.1rem;
- }
- .data-item-action {
- margin-top: 0.1rem;
- color: $primary-color;
- cursor: pointer;
- float: left;
- &:nth-child(2n) {
- margin-left: 0.1rem;
- }
- }
- }
- }
- .content-block.assets {
- display: flex;
- justify-content: space-around;
- margin-top: 0.2rem;
- .content-data-left {
- background-color: #ffffff;
- padding: 0.25rem 0;
- border-radius: 0.03rem;
- width: calc(50% - 0.075rem);
- margin-right: 0.15rem;
- display: flex;
- justify-content: space-around;
- height: 1rem;
- .content-data-item {
- .data-item-title {
- }
- .data-item-value {
- font-size: 0.26rem;
- margin-top: 0.1rem;
- }
- .data-item-action {
- margin-top: 0.15rem;
- color: $primary-color;
- cursor: pointer;
- }
- }
- }
- .content-data-right {
- background-color: #ffffff;
- padding: 0.25rem 0;
- border-radius: 0.03rem;
- width: calc(50% - 0.075rem);
- display: flex;
- justify-content: space-around;
- height: 1rem;
- .content-data-item {
- .data-item-title {
- }
- .data-item-value {
- font-size: 0.26rem;
- margin-top: 0.1rem;
- }
- .data-item-action {
- margin-top: 0.15rem;
- color: $primary-color;
- }
- }
- }
- }
- .content-block.action {
- display: flex;
- justify-content: flex-start;
- margin-top: 0.2rem;
- .content-data-item {
- border: 0.01rem solid #e6e6e6;
- width: calc(100% / 6);
- background-color: #ffffff;
- display: flex;
- padding: 0.15rem 0;
- border-radius: 0.03rem;
- align-items: center;
- text-align: center;
- flex-direction: column;
- margin-right: 0.15rem;
- cursor: pointer;
- .data-item-icon {
- width: 0.55rem;
- height: 0.55rem;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .data-item-value {
- margin-top: 0.1rem;
- }
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
- }
- // pop弹框
- .pop-box {
- background: #ffffff;
- width: 8rem;
- height: 7rem;
- .pop-header {
- padding: 0 0.15rem 0 0.2rem;
- height: 0.5rem;
- line-height: 0.5rem;
- border-bottom: 0.01rem solid #f0f0f0;
- font-size: 0.14rem;
- color: #333;
- overflow: hidden;
- border-radius: 0.02rem 0.2rem 0 0;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- .pop-header-text {
- }
- .pop-header-close {
- cursor: pointer;
- i {
- font-size: 0.18rem;
- }
- }
- }
- .pop-content {
- height: calc(100% - 1rem);
- overflow-y: scroll;
- padding: 0.1rem 0.2rem;
- box-sizing: border-box;
- }
- .pop-bottom {
- button {
- width: 95%;
- }
- }
- }
- //表单
- .form-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- .form-item {
- margin-bottom: 0.1rem;
- display: flex;
- &:last-of-type {
- margin-bottom: 0;
- }
- .form-label {
- width: 1.2rem;
- text-align: right;
- padding-right: 0.1rem;
- box-sizing: border-box;
- height: 0.32rem;
- line-height: 0.32rem;
- .required {
- color: red;
- margin-right: 0.03rem;
- }
- }
- .form-inline {
- width: 2.4rem;
- line-height: 0.32rem;
- margin-right: 0.1rem;
- box-sizing: border-box;
- .form-input {
- border-width: 0.01rem;
- border-style: solid;
- background-color: #fff;
- color: rgba(0, 0, 0, 0.85);
- border-radius: 0.02rem;
- padding-left: 0.1rem;
- height: 0.32rem;
- line-height: 0.32rem;
- font-size: 0.14rem;
- border-color: #e6e6e6;
- border-radius: 0.02rem;
- }
- .form-textarea {
- border-width: 0.01rem;
- border-style: solid;
- background-color: #fff;
- color: rgba(0, 0, 0, 0.85);
- border-radius: 0.02rem;
- padding-left: 0.1rem;
- line-height: 0.32rem;
- font-size: 0.14rem;
- border-color: #e6e6e6;
- width: 100%;
- }
- .word-aux {
- color: #999;
- font-size: 0.12rem;
- line-height: 1.5;
- margin-top: 0.05rem;
- }
- }
- .search-wrap {
- position: relative;
- i {
- position: absolute;
- top: 50%;
- right: 0.1rem;
- transform: translateY(-50%);
- border-left: 0.01rem solid #e6e6e6;
- line-height: 0.3rem;
- padding-left: 0.1rem;
- cursor: pointer;
- }
- }
- }
- }
- .memberInfo-box {
- width: 7.5rem;
- height: 4.21rem;
- }
- .pointPop-box {
- width: 7rem;
- height: 3.94rem;
- }
- .balancePop-box {
- width: 6rem;
- height: 4.2rem;
- }
- .couponlistPop-box {
- width: 10rem;
- height: 5.7rem;
- .pop-content {
- height: calc(100% - 0.5rem);
- }
- /deep/ .tpage {
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .applyMemberPop-box {
- width: 6rem;
- height: 3.38rem;
- .pop-content {
- overflow: initial;
- }
- }
- .cardlistPop-box {
- width: 10rem;
- height: 5.7rem;
- .pop-content {
- height: calc(100% - 0.5rem);
- }
- /deep/ .tpage {
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .sendCoupon-box {
- width: 9rem;
- height: 5.06rem;
- .sendCoupon-content {
- padding: 0.1rem 0.2rem;
- .coupon-table-head {
- display: flex;
- background: #f7f8fa;
- }
- .coupon-table-body {
- height: 3.2rem;
- .coupon-table-tr {
- display: flex;
- border-bottom: 0.01rem solid #e6e6e6;
- }
- .table-input {
- height: 0.3rem;
- line-height: 0.3rem;
- border: 0.01rem solid #e6e6e6;
- padding: 0 0.1rem;
- text-align: center;
- }
- .item-num {
- display: flex;
- align-items: center;
- margin-left: 0.1rem;
- .num-dec {
- width: 0.6rem;
- height: 0.25rem;
- background: #e6e6e6;
- border: 0.01rem solid #e6e6e6;
- border-radius: 30%;
- text-align: center;
- line-height: 0.23rem;
- font-size: 0.25rem;
- margin-right: 0.1rem;
- cursor: pointer;
- transition: 0.3s;
- }
- .num-inc {
- width: 0.6rem;
- height: 0.25rem;
- background: $primary-color;
- border: 0.01rem solid #e6e6e6;
- border-radius: 30%;
- text-align: center;
- line-height: 0.23rem;
- font-size: 0.25rem;
- margin-left: 0.1rem;
- cursor: pointer;
- transition: 0.3s;
- color: #fff;
- }
- }
- .coupon-table-td:nth-child(4) {
- padding: 0 0.05rem;
- }
- }
- .coupon-table-td,
- .coupon-table-th {
- padding: 0 0.1rem;
- display: flex;
- align-items: center;
- height: 0.5rem;
- &:nth-child(1) {
- flex-basis: 30%;
- }
- &:nth-child(2) {
- flex-basis: 20%;
- }
- &:nth-child(3) {
- flex-basis: 30%;
- }
- &:nth-child(4) {
- justify-content: flex-end;
- flex-basis: 20%;
- text-align: right;
- }
- }
- }
- .pop-bottom {
- margin-top: 0.12rem;
- }
- .empty {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 0.5rem;
- border-bottom: 0.01rem solid #e6e6e6;
- color: #909399;
- .iconfont {
- font-size: 0.25rem;
- margin: 0.05rem;
- }
- }
- }
- </style>
|