import toast from '../utils/tool/toast';
export default {

	methods:{
		/* 支付
		* 	mode 状态
		* 		 confirmOrder
		*
		* */
		wxPay:function (data,callback,msg = false) {

			return uni.requestPayment({
				'timeStamp': data.timeStamp,
				'nonceStr': data.nonceStr,
				'package': data.package,
				'signType': data.signType,
				'paySign': data.paySign,
				'complete': (res)=>{
					let status = res.errMsg === 'requestPayment:ok';
					if (msg && !status) {
						toast.info('支付取消');
					}
					return callback && callback(status);
				},
				'success':(res) => {
					if (msg) {
						toast.success('支付成功');
					}
				}
			});




		}
	}

}
