index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" >
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748277.png" mode=""></image>
  21. <text class="text">商品制单</text>
  22. </view>
  23. <view class="item" @click="toCreateCoupon()">
  24. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748287.png" mode=""></image>
  25. <text class="text">制单优惠券</text>
  26. </view>
  27. <!-- <view class="item" @click="toPay()">
  28. <image src="../static/images/money.png" mode=""></image>
  29. <text class="text">微信收款</text>
  30. </view>
  31. <view class="item" @click="alipay()">
  32. <image src="../static/images/money.png" mode=""></image>
  33. <text class="text">支付宝收款</text>
  34. </view> -->
  35. <view class="item" @click="toOrder()">
  36. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748289.png" mode=""></image>
  37. <text class="text">我的订单</text>
  38. </view>
  39. <view class="item" @click="toPackage()">
  40. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748277.png" mode=""></image>
  41. <text class="text">商品套餐</text>
  42. </view>
  43. <view class="item" @click="toCoupon()">
  44. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748288.png" mode=""></image>
  45. <text class="text">套餐优惠券</text>
  46. </view>
  47. <!-- <view class="item" @click="tomanage()">
  48. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748289.png" mode=""></image>
  49. <text class="text">客户管理</text>
  50. </view> -->
  51. </view>
  52. </view>
  53. <!-- 退出登录按钮 -->
  54. <view class="log-out" @click="logout">退出登录</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {getUserInfo,getQrImg} from '@/api/companyUser'
  60. export default {
  61. data() {
  62. return {
  63. user:null,
  64. };
  65. },
  66. onLoad() {
  67. console.log("onload")
  68. },
  69. onShow() {
  70. console.log("onshow")
  71. this.getUserInfo()
  72. },
  73. methods: {
  74. alipay(){
  75. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  76. // uni.setClipboardData({
  77. // data:url,
  78. // success:()=>{
  79. // uni.showToast({
  80. // title:'收款地址已复制到剪切板',
  81. // icon:'none'
  82. // })
  83. // }
  84. // });
  85. uni.navigateTo({
  86. url:'/pages_company/alipayImg'
  87. })
  88. },
  89. tomanage(){
  90. uni.navigateTo({
  91. url:"/pages/user/test/manageUser"
  92. })
  93. },
  94. toCard(){
  95. uni.navigateTo({
  96. url:'/pages_company/card?cardId='+this.user.cardId
  97. })
  98. },
  99. toCreateOrder(){
  100. uni.navigateTo({
  101. url:'/pages_company/order/productList'
  102. })
  103. },
  104. toPay(){
  105. uni.navigateTo({
  106. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  107. })
  108. },
  109. toOrder(){
  110. uni.navigateTo({
  111. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  112. })
  113. },
  114. toPackage(){
  115. uni.navigateTo({
  116. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  117. })
  118. },
  119. toCoupon(){
  120. uni.navigateTo({
  121. url:'/pages_company/coupon'
  122. })
  123. },
  124. toCreateCoupon(){
  125. uni.navigateTo({
  126. url:'/pages_company/order/coupon'
  127. })
  128. },
  129. toCreateOrderCoupon(){
  130. uni.navigateTo({
  131. url:'/pages_company/order/coupon'
  132. })
  133. },
  134. getUserInfo(){
  135. var data={token:uni.getStorageSync('CompanyUserToken')}
  136. getUserInfo(data).then(
  137. res => {
  138. if(res.code==200){
  139. this.user=res.data;
  140. }
  141. else if(res.code==403){
  142. uni.setStorageSync('CompanyUserToken',null);
  143. uni.navigateBack({
  144. delta:-1
  145. })
  146. }else{
  147. uni.showToast({
  148. icon:'none',
  149. title: res.msg,
  150. });
  151. }
  152. },
  153. rej => {}
  154. );
  155. },
  156. logout(){
  157. uni.showModal({
  158. title:"提示",
  159. content:"确认退出登录吗?",
  160. showCancel:true,
  161. cancelText:'取消',
  162. confirmText:'确定',
  163. success:res=>{
  164. if(res.confirm){
  165. uni.setStorageSync('CompanyUserToken',null);
  166. uni.navigateBack({
  167. delta:-1
  168. })
  169. }else{
  170. }
  171. }
  172. })
  173. },
  174. // 跳转页面
  175. navgetTo(url) {
  176. this.utils.isLogin().then(res => {
  177. if(res){
  178. uni.navigateTo({
  179. url: url
  180. })
  181. }
  182. })
  183. },
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .content{
  189. margin: 20upx 0upx;
  190. padding: 0 20upx;
  191. .user-info{
  192. padding: 30upx;
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. .left{
  197. position: relative;
  198. display: flex;
  199. .head-img{
  200. width: 120upx;
  201. height: 120upx;
  202. border-radius: 50%;
  203. overflow: hidden;
  204. margin-right: 30upx;
  205. border: 4upx solid #FFFFFF;
  206. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  207. image{
  208. width: 100%;
  209. height: 100%;
  210. }
  211. }
  212. .name-phone{
  213. padding-top: 15upx;
  214. .name{
  215. font-size: 36upx;
  216. font-family: PingFang SC;
  217. font-weight: bold;
  218. color: #111111;
  219. line-height: 1;
  220. }
  221. .phone{
  222. font-size: 28upx;
  223. font-family: PingFang SC;
  224. font-weight: 500;
  225. color: #666666;
  226. line-height: 1;
  227. margin-top: 30upx;
  228. }
  229. }
  230. }
  231. .msg-box{
  232. padding: 5rpx 15upx;
  233. height: 30upx;
  234. line-height: 30upx;
  235. font-size: 22upx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #FFFFFF;
  239. border-radius: 8rpx;
  240. background-color: #018C39;
  241. }
  242. }
  243. .used-tools{
  244. box-sizing: border-box;
  245. background: #FFFFFF;
  246. border-radius: 16upx;
  247. padding: 40upx 30upx;
  248. .title{
  249. font-size: 32upx;
  250. font-family: PingFang SC;
  251. font-weight: bold;
  252. color: #222222;
  253. line-height: 1;
  254. }
  255. .tools-list{
  256. margin-top: 50upx;
  257. display: flex;
  258. flex-wrap: wrap;
  259. width: 100%;
  260. .item{
  261. box-sizing: border-box;
  262. width: 25%;
  263. display: flex;
  264. flex-direction: column;
  265. align-items: center;
  266. justify-content: center;
  267. margin-bottom: 50upx;
  268. position: relative;
  269. image{
  270. width: 44upx;
  271. height: 44upx;
  272. }
  273. .text{
  274. font-size: 24upx;
  275. font-family: PingFang SC;
  276. font-weight: 500;
  277. color: #111111;
  278. line-height: 1;
  279. margin-top: 20upx;
  280. }
  281. .contact-btn{
  282. display: inline-block;
  283. position: absolute;
  284. top: 0;
  285. left: 0;
  286. width: 100%;
  287. height: 100%;
  288. opacity: 0;
  289. }
  290. }
  291. }
  292. }
  293. .log-out{
  294. height: 80upx;
  295. line-height: 80upx;
  296. text-align: center;
  297. font-size: 26upx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #666666;
  301. background: #FFFFFF;
  302. border-radius: 16upx;
  303. margin-top: 20upx;
  304. }
  305. }
  306. </style>